File size: 1,409 Bytes
6bc1e8d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# Upload to Hugging Face Hub
To upload your model to the Hugging Face Hub, you can use the Hugging Face CLI:
## 1. Install the Hugging Face Hub CLI
```bash
pip install huggingface_hub
```
## 2. Login to Hugging Face
```bash
huggingface-cli login
```
## 3. Create a new repository
Go to https://huggingface.co/new and create a new model repository.
## 4. Upload your model
```bash
cd ./published_model/hf_model
git init
git add .
git commit -m "Initial model upload"
git remote add origin https://huggingface.co/PurelyUnfunctionalAI/GibberishGPT
git push -u origin main
```
Alternatively, you can use the Python API:
```python
from huggingface_hub import HfApi
api = HfApi()
# Login to Hugging Face
api.login()
# Upload model files
api.create_repo(repo_id="PurelyUnfunctionalAI/GibberishGPT", repo_type="model", exist_ok=True)
api.upload_folder(
folder_path="./published_model/hf_model",
repo_id="PurelyUnfunctionalAI/GibberishGPT",
commit_message="Upload model"
)
```
|