mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-05 20:11:08 +08:00
Fix bugs for get_local_dir
This commit is contained in:
@@ -16,7 +16,7 @@ def get_path_list(path):
|
||||
if isinstance(path, str):
|
||||
return [path]
|
||||
else:
|
||||
return [p for p in path]
|
||||
return list(path)
|
||||
|
||||
|
||||
def sys_config(config, config_path):
|
||||
|
||||
@@ -245,10 +245,10 @@ class MLflowRecorder(Recorder):
|
||||
This function will return the directory path of this recorder.
|
||||
"""
|
||||
if self.artifact_uri is not None:
|
||||
local_file_prefix = "file:"
|
||||
if self.artifact_uri.startswith(local_file_prefix):
|
||||
xpath = self.artifact_uri.lstrip(local_file_prefix)
|
||||
return (Path(xpath) / "..").resolve()
|
||||
local_dir_path = Path(self.artifact_uri.lstrip("file:")) / ".."
|
||||
local_dir_path = str(local_dir_path.resolve())
|
||||
if os.path.isdir(local_dir_path):
|
||||
return local_dir_path
|
||||
else:
|
||||
raise RuntimeError("This recorder is not saved in the local file system.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user