Skip to content

Commit

Permalink
Use mlflow.flush_async_loggin
Browse files Browse the repository at this point in the history
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
  • Loading branch information
harupy committed Feb 27, 2024
1 parent e02987f commit 4b9a2ab
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/transformers/test_transformers_autolog.py
@@ -1,5 +1,4 @@
import random
import time

import numpy as np
import optuna
Expand Down Expand Up @@ -504,7 +503,7 @@ def test_trainer_hyperparameter_tuning_does_not_log_sklearn_model(
exp = mlflow.set_experiment(experiment_name="hyperparam_trainer")

transformers_hyperparameter_trainer.train()
time.sleep(5) # wait for async logging to finish
mlflow.flush_async_logging()

last_run = mlflow.last_active_run()
assert last_run.data.metrics["epoch"] == 3.0
Expand All @@ -531,7 +530,7 @@ def test_trainer_hyperparameter_tuning_functional_does_not_log_sklearn_model(
exp = mlflow.set_experiment(experiment_name="hyperparam_trainer_functional")

transformers_hyperparameter_functional.train()
time.sleep(5) # wait for async logging to finish
mlflow.flush_async_logging()

last_run = mlflow.last_active_run()
assert last_run.data.metrics["epoch"] == 1.0
Expand Down

0 comments on commit 4b9a2ab

Please sign in to comment.