Export¶
- metatrain.cli.export.export_model(path: Path | str, output: Path | str, path_in_repo: str | None = None, extensions: Path | str = 'extensions/', hf_token: str | None = None, metadata: ModelMetadata | None = None, revision: str | None = None) None[source]¶
Export a trained model allowing it to make predictions.
This includes predictions within molecular simulation engines. Exported models will be saved with a
.ptfile ending. Ifpathdoes not end with this file extensions.ptwill be added and a warning emitted.The user can specify the model in three ways:
Local File:
mtt export model.ckpt
Hugging Face Repository (GitHub-style):
mtt export metatensor/metatrain-test model.ckpt
Any URL:
mtt export https://huggingface.co/metatensor/metatrain-test/resolve/main/model.ckpt
- Parameters:
path (Path | str) – path to a model file to be exported, or a Hugging Face repo ID
path_in_repo (str | None) – path to the model file within the Hugging Face repository
hf_token (str | None) – HuggingFace API token to download (private) models from HuggingFace (optional)
metadata (ModelMetadata | None) – metadata to be appended to the model
revision (str | None) – Revision (branch, tag, or commit) to download from Hugging Face
- Return type:
None