fix: mlflow run — guard set_experiment под MLFLOW_RUN_ID + рецепт (tracking URI, venv, --env-manager local)

This commit is contained in:
2026-07-21 01:19:40 +03:00
parent ae62641cbc
commit c8043ad7c4
5 changed files with 34 additions and 10 deletions
+4 -1
View File
@@ -69,7 +69,10 @@ def main():
X, y, test_size=0.2, random_state=42
)
mlflow.set_experiment(args.experiment_name)
# под `mlflow run` эксперимент уже задан Projects (MLFLOW_RUN_ID) —
# не переопределяем, иначе конфликт "active experiment ID does not match".
if not os.environ.get("MLFLOW_RUN_ID"):
mlflow.set_experiment(args.experiment_name)
best_acc = 0.0
best_run_id = None