Artifact Specs
Pydantic models for specifying the save/load rules of an artifact, like where it comes from, which schema is to be used, etc.
Mostly meant for applications that are based on configuration files, so the logic for loading/saving a run artifact or model version can be fully encoded in the configuration and there’s no need to change the code when an artifact specification is changed.
- pydantic model mlopus.artschema.RunArtifact[source]
Bases:
ArtifactSubject[RunApi, _RunLineageArg]
Specification of a run artifact.
-
field optional:
bool
= False Skip silently if run artifact is missing at load time.
New in version 1.3.0.
-
field path_in_run:
str
= None
-
field run_id:
str
= None
-
field optional:
- pydantic model mlopus.artschema.ModelVersionArtifact[source]
Bases:
ArtifactSubject[ModelVersionApi, _ModelLineageArg]
Specification of a model version artifact.
-
field model_name:
str
[Required] Parent model name.
-
field model_version:
Optional
[str
] = None Required when loading, optional when publishing.
-
field path_in_run:
Optional
[str
] = None Only used when publishing. See
path_in_run
.
-
field run_id:
str
= None Parent run ID. Required when publishing.
-
field tags:
Optional
[Mapping
] = None Optional, only used when publishing. See
mlopus.mlflow.schema.ModelVersion.tags
.
-
field model_name:
- pydantic model mlopus.artschema.LogArtifactSpec[source]
Bases:
MlflowApiMixin
,Generic
[T
,LA
]Specification for logging an artifact.
-
field allow_duplication:
Optional
[bool
] = None
-
field auto_register:
Union
[bool
,Dict
[str
,Any
]] = False See
mlopus.artschema.log_run_artifact.auto_register
andmlopus.artschema.log_model_version.auto_register
-
field keep_the_source:
Optional
[bool
] = None See
keep_the_source
-
field skip_reqs_check:
bool
= False See
skip_reqs_check
-
field subject:
ArtifactSubject
[Required] Instance (or dict to be parsed into instance) of
RunArtifact
orModelVersionArtifact
. See also:subject
.
-
field allow_duplication:
- pydantic model mlopus.artschema.LoadArtifactSpec[source]
Bases:
MlflowApiMixin
,Generic
[T
,LA
]Specification for loading an artifact.
-
field export_opts:
ExportOptions
[Optional] Options for exporting artifact cache.
New in version 1.4.
-
field skip_reqs_check:
bool
= False See
skip_reqs_check
-
field subject:
ArtifactSubject
[Required] Instance (or dict to be parsed into instance) of
RunArtifact
orModelVersionArtifact
. See also:subject
.
- download()[source]
Cache subject metadata and artifact.
See also
- Return type:
Path
- Returns:
A Path to the cached artifact.
- property entity_api: T
Entity metadata with MLFlow API handle.
-
field export_opts:
- pydantic model mlopus.artschema.specs.ExportOptions[source]
Bases:
BaseModel
Options for exporting artifact cache.
New in version 1.4.
-
field ignore_globs:
List
[str
] [Optional] Export only the artifact files that do not match these glob patterns.
-
field metadata_only:
bool
= False Export metadata only, not the actual artifact file(s).
-
field ignore_globs: