Skip to content

Commit

Permalink
Fix MLflow registry methods with empty metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
avishniakov authored Sep 27, 2023
1 parent 7202b59 commit e382ebe
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 5 deletions.
1 change: 0 additions & 1 deletion template/steps/inference/inference_get_current_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def inference_get_current_version() -> Annotated[str, "model_version"]:

current_version = model_registry.list_model_versions(
name=MetaConfig.mlflow_model_name,
metadata={},
stage=MetaConfig.target_env,
)[0].version
logger.info(
Expand Down
2 changes: 0 additions & 2 deletions template/steps/promotion/promote_get_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ def promote_get_versions() -> (
### ADD YOUR OWN CODE HERE - THIS IS JUST AN EXAMPLE ###
none_versions = model_registry.list_model_versions(
name=MetaConfig.mlflow_model_name,
metadata={},
stage=None,
)
latest_versions = none_versions[0].version
logger.info(f"Latest model version is {latest_versions}")

target_versions = model_registry.list_model_versions(
name=MetaConfig.mlflow_model_name,
metadata={},
stage=MetaConfig.target_env,
)
current_version = latest_versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,11 @@ def promote_metric_compare_promoter(
name=MetaConfig.mlflow_model_name,
version=current_version,
stage=ModelVersionStage.ARCHIVED,
metadata={},
)
model_registry.update_model_version(
name=MetaConfig.mlflow_model_name,
version=latest_version,
stage=MetaConfig.target_env,
metadata={},
)
promoted_version = latest_version

Expand Down

0 comments on commit e382ebe

Please sign in to comment.