1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-06-06 05:51:17 +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'
pr = urlparse(config)
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)
else:
with config.open("rb") as f: