From 4fc8a5f25fe2ea7cf498829bbafa773633b43fc0 Mon Sep 17 00:00:00 2001 From: BookSword Date: Thu, 23 Mar 2023 15:35:59 +0800 Subject: [PATCH] merge --- qlib/utils/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qlib/utils/__init__.py b/qlib/utils/__init__.py index 3bfacc28..ea2f0cde 100644 --- a/qlib/utils/__init__.py +++ b/qlib/utils/__init__.py @@ -426,7 +426,8 @@ def init_instance_by_config( # path like '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: