publish_to_hf_hub - Tinker Documentation

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.

Works with outputs from build_hf_model, build_lora_adapter, or any HuggingFace-compatible model directory.

Parameters:

Returns: URL of the published repository.

from tinker_cookbook import weights
url = weights.publish_to_hf_hub(
model_path="./merged_model",
repo_id="my-org/my-model",
)
print(url)