Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mlflow.flush_async_logging instead of time.sleep in transformers tests #11254

Merged
merged 1 commit into from Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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