tinker_cookbook.weights.publish_to_hf_hub
tinker_cookbook.weights.publish_to_hf_hub(model_path, repo_id, private, token, model_card)
Push a model or adapter directory to HuggingFace Hub.
Parameters:
- model_path (str) – Local path to the model or adapter directory to upload.
- repo_id (str) – HuggingFace Hub repository ID (e.g.
"user/my-model"). - private (bool) – Whether the repository should be private. Defaults to
Truefor safety. - token (str | None) – HuggingFace API token. If
None(default), uses theHF_TOKENenvironment variable or cached login fromhf auth login. - model_card (ModelCardConfig | None) – Optional model card configuration. When provided, a
README.mdis auto-generated and included in the upload. If the directory already contains aREADME.md, the existing file is preserved and a warning is logged.
Returns: URL of the published repository.