1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-09 22:10:56 +08:00
This commit is contained in:
BookSword
2023-03-23 15:35:59 +08:00
parent 76f2fb1a1a
commit 4fc8a5f25f

View File

@@ -426,7 +426,8 @@ def init_instance_by_config(
# path like 'file:///<path to pickle file>/obj.pkl' # path like 'file:///<path to pickle file>/obj.pkl'
pr = urlparse(config) pr = urlparse(config)
if pr.scheme == "file": if pr.scheme == "file":
with open(os.path.join(pr.netloc, pr.path), "rb") as f: pr_path = os.path.join(pr.netloc, pr.path) if bool(pr.path) else pr.netloc
with open(pr_path, "rb") as f:
return pickle.load(f) return pickle.load(f)
else: else:
with config.open("rb") as f: with config.open("rb") as f: