Prerequisites
- Hugging Face account: https://huggingface.co
- Personal Access Token with read access: https://huggingface.co/settings/tokens
huggingface_hubandtransformersinstalled
Create a model repository
Create a new model repo on Hugging Face (UI or CLI)- UI: New model at https://huggingface.co/new
- CLI:
Required files
Your repository should include:- Model weights in
.safetensorsformat - Model configuration files (e.g.,
config.json) - Tokenizer files (e.g.,
tokenizer.json,tokenizer_config.json,vocab.json,merges.txt) - Any processors (e.g.,
preprocessor_config.json, image processor files) - A
README.mddescribing the model
- Transformers docs: https://huggingface.co/docs/transformers/index
- Model files and formats: https://huggingface.co/docs/hub/models-files
- Safetensors format: https://huggingface.co/docs/safetensors/index
Push model weights and artifacts
Below is a Python example that saves a model and tokenizer, then pushes them to the Hub usingtransformers and huggingface_hub.
Verify repository readiness
- Check that all required files are present (weights, config, tokenizer, processors)
- Confirm weights are in
.safetensors - Ensure
README.mdhas a pipeline tag, for example: