Model API

pydantic model mlopus.mlflow.ModelApi[source]

Bases: Model, EntityApi

Registered model metadata with MLflow API handle.

field name: str [Required]

Model vame in the pattern [w-./]+

field tags: Dict[str, Any] [Required]

Nested tags dict with JSON-serializable leaf-values and keys in the pattern: [w-/]+

class Config

Bases: object

Pydantic class config.

cache_meta()[source]

Fetch latest metadata for this model and save it to cache.

Return type:

ModelApi

export_meta(target)[source]

Export model metadata cache to target.

Parameters:

target (Path) – Cache export path.

Return type:

ModelApi

find_versions(query=None, sorting=None)[source]

Search versions of this model with query in MongoDB query language.

Parameters:
  • query (Optional[Dict[str, Any]]) – Query in MongoDB query language.

  • sorting (Optional[List[Tuple[str, Literal[1, -1]]]]) – Sorting criteria (e.g.: [(“asc_field”, 1), (“desc_field”, -1)]).

Return type:

Iterator[ModelVersionApi]

get_version(version)[source]

Get ModelVersion API by version identifier.

Parameters:

version (str) – Version identifier.

Return type:

ModelVersionApi

log_version(run, source, path_in_run=None, keep_the_source=None, allow_duplication=None, use_cache=None, version=None, tags=None)[source]

Publish artifact file or dir as model version inside the specified experiment run.

Parameters:
Return type:

ModelVersionApi

Returns:

New model version metadata with API handle.

set_tags(tags)[source]

Set tags on this model.

Parameters:

tags (Mapping) – See schema.Model.tags.

Return type:

ModelApi

update()

Use API to get latest data for this entity and update this entity in place.

Return type:

EntityApi

property url: str

This model’s URL.