зеркало из https://github.com/microsoft/qlib.git
merge
This commit is contained in:
Родитель
76f2fb1a1a
Коммит
4fc8a5f25f
|
@ -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:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче