For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python function
deserialize
deserialize()
max.pipelines.lib.artifact.deserialize(path: str | PathLike[str]) → ModelArtifact
max.pipelines.lib.artifact.deserialize(path: str | PathLike[str], artifact_type: type[A]) → A
Deserializes a model artifact from a .m directory.
Before any component is loaded, every file listed in the metadata is checksummed, and Hugging Face references are snapshotted.
-
Parameters:
-
- path – The artifact directory.
- artifact_type – The artifact class. Each component is deserialized with
the class its slot is annotated with, from
ModelArtifact.component_types().
-
Returns:
-
The deserialized artifact. File references point into
path. -
Raises:
-
ArtifactError – If the artifact is missing or modified, a cached Hugging Face snapshot lacks a referenced path, or a component can’t be deserialized.