diff --git a/src/models/train.py b/src/models/train.py index c7125dd..a2f7e50 100644 --- a/src/models/train.py +++ b/src/models/train.py @@ -16,10 +16,17 @@ import pandas as pd # Configure MLflow mlflow.set_tracking_uri(os.getenv("MLFLOW_TRACKING_URI", "https://mlflow.sortifal.dev")) +# Set MLflow credentials from environment variables +if os.getenv("MLFLOW_TRACKING_USERNAME") and os.getenv("MLFLOW_TRACKING_PASSWORD"): + os.environ["MLFLOW_TRACKING_USERNAME"] = os.getenv("MLFLOW_TRACKING_USERNAME") + os.environ["MLFLOW_TRACKING_PASSWORD"] = os.getenv("MLFLOW_TRACKING_PASSWORD") + print("MLflow credentials configured from environment variables") + # Try to set experiment, but handle auth errors gracefully USE_MLFLOW = True try: mlflow.set_experiment("csgo-match-prediction") + print(f"Connected to MLflow at {mlflow.get_tracking_uri()}") except Exception as e: print(f"Warning: Could not connect to MLflow: {e}") print("Training will continue without MLflow tracking.")