Skip to content

Commit

Permalink
Changed filter for models
Browse files Browse the repository at this point in the history
  • Loading branch information
JarcauCristian committed Apr 10, 2024
1 parent 9545ea7 commit 06f9a61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mlflow_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self):

def models(self):
returns = []
models_list = self.client.search_registered_models()
models_list = self.client.search_registered_models("tag.mage_model = 'true'")

if not models_list:
return None
Expand All @@ -64,6 +64,7 @@ def model_parameters(self, name: str) -> Dict[str, Any] | None:

def model_versions(self, name: str) -> List[Dict[str, str]] | None:
versions = self.client.search_model_versions(f"name='{name}'")

return [{"version": version.version,
"type": "" if version.tags.get("model_type") is None else version.tags["model_type"]}
for version in versions]
Expand Down

0 comments on commit 06f9a61

Please sign in to comment.