terra.push_model_to_hub

terra.push_model_to_hub#

terra.push_model_to_hub(model_folder, repo_id, *, corpus=None, private=True, tag=None, license='cc-by-nc-4.0', training_data=None, paper_url=None, model_card=None, commit_message=None, prune_stale=True, token=None)#

Create (if needed) a Hugging Face model repo and upload a TERRA model bundle.

Only the standard bundle files present in model_folder are uploaded (training cruft like optimizer state / logs / intermediate epochs is skipped). A model card is generated unless model_card is provided. If tag is given, an immutable git tag is created on the uploaded revision – use it to pin the manuscript checkpoint (e.g. v1.0).

When prune_stale is set (default), bundle-type files (.pt/.pth/.pkl/.yaml/.yml/.csv) that exist on the Hub but are absent from model_folder are deleted in the same commit – so renamed/removed files (e.g. a pre-rename ensembl_dic.pkl) don’t linger. README.md and .gitattributes are never pruned.

Returns the repository URL.

Return type:

str