Principle:Unslothai Unsloth Hub Upload
| Knowledge Sources | |
|---|---|
| Domains | Model_Deployment, Model_Sharing |
| Last Updated | 2026-02-07 00:00 GMT |
Overview
A model distribution technique that uploads merged or quantized models to HuggingFace Hub with auto-generated model cards and repository metadata.
Description
Hub upload enables sharing fine-tuned models with the community or deploying them to HuggingFace Inference Endpoints. The process:
- Merge and Save: Locally merges LoRA weights (if needed) and saves the model.
- Repository Creation: Creates or updates a HuggingFace Hub repository.
- File Upload: Uploads model weights, config, tokenizer, and model card.
- Model Card Generation: Auto-generates a model card with training metadata, base model info, and Unsloth attribution.
Supports both SafeTensors (push_to_hub_merged) and GGUF (push_to_hub_gguf) upload workflows.
Usage
Use after training when you want to share or deploy the model publicly or privately on HuggingFace Hub. Requires a HuggingFace authentication token with write permissions.
Theoretical Basis
Hub upload is a distribution mechanism, not an algorithmic technique. The key workflow is:
# Abstract Hub upload pipeline
model_dir = merge_and_save(model, tokenizer)
repo = create_or_update_repo(repo_id, private=False)
upload_files(repo, model_dir)
generate_model_card(repo, base_model, training_params)