1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-14 16:26:55 +08:00

recorder support upload both raw file and directory

This commit is contained in:
Young
2021-07-25 16:35:16 +00:00
parent 3810a4cd33
commit 1d22ee56d3

View File

@@ -299,7 +299,11 @@ class MLflowRecorder(Recorder):
def save_objects(self, local_path=None, artifact_path=None, **kwargs): def save_objects(self, local_path=None, artifact_path=None, **kwargs):
assert self.uri is not None, "Please start the experiment and recorder first before using recorder directly." assert self.uri is not None, "Please start the experiment and recorder first before using recorder directly."
if local_path is not None: if local_path is not None:
self.client.log_artifacts(self.id, local_path, artifact_path) path = Path(local_path)
if path.is_dir():
self.client.log_artifacts(self.id, local_path, artifact_path)
else:
self.client.log_artifact(self.id, local_path, artifact_path)
else: else:
temp_dir = Path(tempfile.mkdtemp()).resolve() temp_dir = Path(tempfile.mkdtemp()).resolve()
for name, data in kwargs.items(): for name, data in kwargs.items():