mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-09 22:10:56 +08:00
merge
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user