Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,64 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: cc0-1.0
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc0-1.0
|
| 3 |
+
---
|
| 4 |
+
# Uploading Large Files to Hugging Face Models: A Comprehensive Guide
|
| 5 |
+
|
| 6 |
+
## Prerequisites
|
| 7 |
+
- Git installed
|
| 8 |
+
- Git LFS installed
|
| 9 |
+
- Python with `huggingface_hub` library
|
| 10 |
+
- Hugging Face account
|
| 11 |
+
|
| 12 |
+
## Step-by-Step Instructions
|
| 13 |
+
|
| 14 |
+
### 1. Install Required Tools
|
| 15 |
+
```bash
|
| 16 |
+
# Install Hugging Face CLI
|
| 17 |
+
python -m pip install huggingface_hub
|
| 18 |
+
|
| 19 |
+
# Login to Hugging Face
|
| 20 |
+
huggingface-cli login
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
### 2. Create Repository
|
| 24 |
+
1. Go to [https://huggingface.co/new](https://huggingface.co/new)
|
| 25 |
+
2. Create a new model repository
|
| 26 |
+
3. Copy the repository URL
|
| 27 |
+
|
| 28 |
+
### 3. Clone Repository Locally
|
| 29 |
+
```bash
|
| 30 |
+
git clone https://huggingface.co/<your-username>/<your-model-name>
|
| 31 |
+
cd <your-model-name>
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
### 4. Prepare for Large File Uploads
|
| 35 |
+
```bash
|
| 36 |
+
# Initialize Git LFS
|
| 37 |
+
git lfs install
|
| 38 |
+
|
| 39 |
+
# Enable large file support
|
| 40 |
+
huggingface-cli lfs-enable-largefiles .
|
| 41 |
+
|
| 42 |
+
# Track safetensor files
|
| 43 |
+
git lfs track "*.safetensors" "*.json"
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
### 5. Add and Push Files
|
| 47 |
+
```bash
|
| 48 |
+
# Copy safetensor files to repository directory
|
| 49 |
+
# Then run:
|
| 50 |
+
git add .
|
| 51 |
+
git commit -m "Add model safetensor files"
|
| 52 |
+
git push
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
## Troubleshooting
|
| 56 |
+
- Ensure files are < 5GB per file
|
| 57 |
+
- Check internet connection
|
| 58 |
+
- Verify Git LFS is correctly installed
|
| 59 |
+
- Use `git lfs status` to check file tracking
|
| 60 |
+
|
| 61 |
+
## Best Practices
|
| 62 |
+
- Use descriptive commit messages
|
| 63 |
+
- Keep repository organized
|
| 64 |
+
- Include a README.md with model details
|