Skip to content

Commit 7bc1b70

Browse files
authored
[Fix] mlflow attr (#135)
🐛 Fix mlflow attr
1 parent 098cb73 commit 7bc1b70

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

siatune/tune/callbacks/mlflow.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ def setup(self, *args, **kwargs):
6565
"""In addition to create `mlflow` experiment, create a parent run to
6666
bind multiple trial runs."""
6767
super().setup(*args, **kwargs)
68+
69+
self.client = self.mlflow_util._get_client()
70+
self.experiment_id = self.mlflow_util.experiment_id
6871
self.parent_run = self.client.create_run(
6972
experiment_id=self.experiment_id, tags=self.tags)
7073

@@ -140,7 +143,7 @@ def on_experiment_end(self, trials: List['Trial'], **info):
140143
for key, value in run.data.metrics.items():
141144
self.client.log_metric(run_id=parent_run_id, key=key, value=value)
142145

143-
if self.save_artifact:
146+
if self.should_save_artifact:
144147
self.client.log_artifacts(
145148
parent_run_id, local_dir=best_trial.logdir)
146149

0 commit comments

Comments
 (0)