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
serialize
serialize()
max.pipelines.lib.artifact.serialize(model_artifact, path)
Serializes a model artifact to a .m directory.
The directory is written to a temporary sibling and renamed into place, so a failed export never leaves a partial artifact behind.
-
Parameters:
-
- model_artifact (ModelArtifact) – The artifact to serialize.
- path (str | PathLike[str]) – The destination.
.mis appended unless it already ends in.m.
-
Returns:
-
The path of the written artifact directory.
-
Raises:
-
ArtifactError – If the destination exists or a component’s serialized form is invalid.
-
Return type:
-
Path