Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2025 12:50 PM - edited 08-21-2025 12:52 PM
Hi @Yuki,
Thank you for contacting the Databricks community.
-
If you run
register_modelwith the same run twice, you’ll create multiple versions pointing to the same source. -
To avoid that, you can check if the run is already registered before creating a new version:
from mlflow.tracking import MlflowClient client = MlflowClient() existing = [ v.source for v in client.search_model_versions(f"name='{model_name}'") ] if f"runs:/{best_run.run_id}/model" not in existing: result = mlflow.register_model(f"runs:/{best_run.run_id}/model", model_name)