Spaces:
Paused
Paused
feat: restore story cover PNGs via Xet storage + migration docs
Browse filesdocs: update migration guide with successful git-xet solution
docs: highlight problematic commits that caused PNG rejection issue
test: verify HF accepts push (PNG rejection fixed)
- README.md +1 -0
- assets/covers/The_Adventures_of_Puss_in_Boots.png +3 -0
- assets/covers/The_History_of_Tom_Thumb.png +3 -0
- assets/covers/The_Little_Gingerbread_Man.png +3 -0
- assets/covers/The_Little_Red_Hen.png +3 -0
- assets/covers/The_Sleeping_Beauty.png +3 -0
- assets/covers/The_Story_of_the_Three_Little_Pigs.png +3 -0
- assets/covers/The_Tale_of_Benjamin_Bunny.png +3 -0
- assets/covers/The_Tale_of_Jemima_Puddle_Duck.png +3 -0
- assets/covers/The_Tale_of_Peter_Rabbit.png +3 -0
- assets/covers/The_Tale_of_Tom_Kitten.png +3 -0
- gitmigration.md +202 -0
README.md
CHANGED
|
@@ -137,3 +137,4 @@ All inference runs on the Hugging Face Space GPU. Voice samples, story text, and
|
|
| 137 |
## License
|
| 138 |
|
| 139 |
Hackathon project. Stories are public domain.
|
|
|
|
|
|
| 137 |
## License
|
| 138 |
|
| 139 |
Hackathon project. Stories are public domain.
|
| 140 |
+
test push verification
|
assets/covers/The_Adventures_of_Puss_in_Boots.png
ADDED
|
Git LFS Details
|
assets/covers/The_History_of_Tom_Thumb.png
ADDED
|
|
Git LFS Details
|
assets/covers/The_Little_Gingerbread_Man.png
ADDED
|
Git LFS Details
|
assets/covers/The_Little_Red_Hen.png
ADDED
|
Git LFS Details
|
assets/covers/The_Sleeping_Beauty.png
ADDED
|
Git LFS Details
|
assets/covers/The_Story_of_the_Three_Little_Pigs.png
ADDED
|
Git LFS Details
|
assets/covers/The_Tale_of_Benjamin_Bunny.png
ADDED
|
Git LFS Details
|
assets/covers/The_Tale_of_Jemima_Puddle_Duck.png
ADDED
|
Git LFS Details
|
assets/covers/The_Tale_of_Peter_Rabbit.png
ADDED
|
Git LFS Details
|
assets/covers/The_Tale_of_Tom_Kitten.png
ADDED
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HuggingFace Spaces Git Migration: LFS β Xet Storage
|
| 2 |
+
|
| 3 |
+
## Problem
|
| 4 |
+
|
| 5 |
+
HuggingFace Spaces deprecated Git LFS and now requires **Xet storage** for binary files (images, audio, models, etc.).
|
| 6 |
+
|
| 7 |
+
When pushing to HF Spaces with LFS-tracked files:
|
| 8 |
+
```
|
| 9 |
+
remote: Your push was rejected because it contains binary files.
|
| 10 |
+
remote: Please use https://huggingface.co/docs/hub/xet to store binary files.
|
| 11 |
+
```
|
| 12 |
+
|
| 13 |
+
**Why:** HF's pre-receive hook scans git history and rejects any commits with binary files routed via LFS. It requires Xet protocol instead.
|
| 14 |
+
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
## β οΈ Important: Problematic Commits to Clean Up
|
| 18 |
+
|
| 19 |
+
The following commits attempted to add PNG files **before git-xet was properly installed and configured**. These caused the rejection error:
|
| 20 |
+
|
| 21 |
+
- **`d9520f4`** - "feat: replace Unsplash cover URLs with local assets/covers/ PNG paths"
|
| 22 |
+
- **`f423e05`** - "feat: replace Unsplash cover URLs with local assets/covers/ PNG paths" (duplicate)
|
| 23 |
+
|
| 24 |
+
**Status:** β
These commits were cleaned up via `git-filter-repo` and PNG files were restored via proper git-xet workflow.
|
| 25 |
+
|
| 26 |
+
**For future reference:** Always ensure git-xet is installed and configured **before** committing large binary files. If this happens again:
|
| 27 |
+
|
| 28 |
+
```bash
|
| 29 |
+
# Remove problematic commits from history
|
| 30 |
+
git filter-repo --path assets/covers/ --invert-paths --force
|
| 31 |
+
|
| 32 |
+
# Restore from backup or re-add with git-xet properly configured
|
| 33 |
+
# Then push
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
---
|
| 37 |
+
|
| 38 |
+
## The Solution: Use git-xet
|
| 39 |
+
|
| 40 |
+
Store large binary files in git using **Xet protocol** instead of deprecated LFS.
|
| 41 |
+
|
| 42 |
+
**Why git-xet:**
|
| 43 |
+
- β
Binary files remain in git history (version-controlled)
|
| 44 |
+
- β
Standard git workflow (no special handling)
|
| 45 |
+
- β
Automatic deduplication & fast transfers
|
| 46 |
+
- β
HF officially supports and recommends it
|
| 47 |
+
- β
Works with existing `.gitattributes` configuration
|
| 48 |
+
|
| 49 |
+
---
|
| 50 |
+
|
| 51 |
+
## How We Fixed It (Step-by-Step)
|
| 52 |
+
|
| 53 |
+
### Step 1: Verify git-xet is Installed
|
| 54 |
+
```bash
|
| 55 |
+
git xet --version
|
| 56 |
+
# Output: git-xet 0.2.1
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
If not installed:
|
| 60 |
+
```bash
|
| 61 |
+
# macOS/Linux
|
| 62 |
+
brew install git-xet
|
| 63 |
+
git xet install
|
| 64 |
+
|
| 65 |
+
# Or download from: https://github.com/huggingface/xet-core/releases
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
### Step 2: Verify .gitattributes Configuration
|
| 69 |
+
Your `.gitattributes` should route binary files through LFS (git-xet intercepts):
|
| 70 |
+
|
| 71 |
+
```
|
| 72 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 73 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 74 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 75 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 76 |
+
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
With git-xet installed, these files automatically route through **Xet protocol** instead of legacy LFS.
|
| 80 |
+
|
| 81 |
+
### Step 3: Remove from .gitignore
|
| 82 |
+
If binaries are in `.gitignore`, remove them so they can be tracked:
|
| 83 |
+
|
| 84 |
+
```bash
|
| 85 |
+
# Edit .gitignore and remove any lines excluding your binaries
|
| 86 |
+
# Example: remove "assets/covers/" line
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
### Step 4: Add and Commit Binaries
|
| 90 |
+
```bash
|
| 91 |
+
git add assets/covers/
|
| 92 |
+
git commit -m "feat: add story cover images via Xet storage"
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
### Step 5: Push to HF Space
|
| 96 |
+
```bash
|
| 97 |
+
git push steve-hf main
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
**What happens:**
|
| 101 |
+
- β
Git detects binary files routed via `filter=lfs`
|
| 102 |
+
- β
git-xet intercepts and uses **Xet protocol** (not legacy LFS)
|
| 103 |
+
- β
Files upload via chunk-deduplication
|
| 104 |
+
- β
HF pre-receive hook accepts them (no "binary files rejected" error)
|
| 105 |
+
|
| 106 |
+
**Verification:**
|
| 107 |
+
```bash
|
| 108 |
+
# Verify files are tracked in git
|
| 109 |
+
git ls-files | grep -i png
|
| 110 |
+
|
| 111 |
+
# Verify push succeeded
|
| 112 |
+
git log --oneline -2
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
---
|
| 116 |
+
|
| 117 |
+
## Key Takeaways
|
| 118 |
+
|
| 119 |
+
| Aspect | Before | After |
|
| 120 |
+
|--------|--------|-------|
|
| 121 |
+
| **Problem** | HF rejected LFS-tracked binary files | β
Resolved with git-xet |
|
| 122 |
+
| **Git history** | Contained PNG LFS pointers | Properly tracked via Xet |
|
| 123 |
+
| **PNG files** | Attempted LFS upload (rejected) | Committed via Xet protocol |
|
| 124 |
+
| **Storage backend** | Legacy HF LFS (no longer supported) | HF Xet (official standard) |
|
| 125 |
+
| **Push status** | β "binary files rejected" hook error | β
Successful push |
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
## Future Workflows
|
| 130 |
+
|
| 131 |
+
### Adding New Binary Files
|
| 132 |
+
Once git-xet is installed and `.gitattributes` is configured, just use normal git:
|
| 133 |
+
|
| 134 |
+
```bash
|
| 135 |
+
git add new_file.png
|
| 136 |
+
git commit -m "Add new image"
|
| 137 |
+
git push origin main
|
| 138 |
+
# Files automatically routed through Xet protocol
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
### Cloning the Repository
|
| 142 |
+
With git-xet installed, cloning and pulling works normally:
|
| 143 |
+
|
| 144 |
+
```bash
|
| 145 |
+
git clone git@hf.co:spaces/sshtel/Huggingface_Hack
|
| 146 |
+
cd Huggingface_Hack
|
| 147 |
+
# Binary files auto-downloaded via Xet deduplication
|
| 148 |
+
```
|
| 149 |
+
|
| 150 |
+
### Updating Existing Binary Files
|
| 151 |
+
```bash
|
| 152 |
+
# Modify a PNG file
|
| 153 |
+
# (e.g., replace cover image)
|
| 154 |
+
|
| 155 |
+
git add assets/covers/changed_image.png
|
| 156 |
+
git commit -m "Update cover image"
|
| 157 |
+
git push steve-hf main
|
| 158 |
+
# Only changed chunks uploaded via Xet (efficient)
|
| 159 |
+
```
|
| 160 |
+
|
| 161 |
+
---
|
| 162 |
+
|
| 163 |
+
## Files Changed
|
| 164 |
+
|
| 165 |
+
- **Added:** `assets/covers/*.png` (10 story cover images, 19 MB total)
|
| 166 |
+
- Tracked in git via Xet protocol
|
| 167 |
+
- Routed through `filter=lfs` in `.gitattributes`
|
| 168 |
+
- **Created:** `gitmigration.md` (this file)
|
| 169 |
+
- **Kept:** `.gitattributes` (LFS syntax, git-xet intercepts)
|
| 170 |
+
- **Cleaned:** `.gitignore` (removed `assets/covers/` exclusion)
|
| 171 |
+
|
| 172 |
+
---
|
| 173 |
+
|
| 174 |
+
## References
|
| 175 |
+
|
| 176 |
+
- [HuggingFace Docs: Xet Storage with Git](https://huggingface.co/docs/hub/xet/using-xet-storage#git)
|
| 177 |
+
- [Git Xet Repository](https://github.com/huggingface/xet-core)
|
| 178 |
+
- [HF Docs: Upload Files](https://huggingface.co/docs/huggingface_hub/guides/upload)
|
| 179 |
+
- [Xet Protocol: Chunk Deduplication](https://huggingface.co/docs/xet/index)
|
| 180 |
+
|
| 181 |
+
## Troubleshooting
|
| 182 |
+
|
| 183 |
+
### "Your push was rejected because it contains binary files"
|
| 184 |
+
**Solution:** Ensure git-xet is installed and `.gitattributes` is configured:
|
| 185 |
+
```bash
|
| 186 |
+
git xet --version # Verify installation
|
| 187 |
+
git config --global --list | grep xet # Verify config
|
| 188 |
+
cat .gitattributes # Verify routing rules
|
| 189 |
+
```
|
| 190 |
+
|
| 191 |
+
### Large file uploads are slow
|
| 192 |
+
**Solution:** git-xet has adaptive concurrency. For high-bandwidth machines:
|
| 193 |
+
```bash
|
| 194 |
+
export HF_XET_HIGH_PERFORMANCE=1
|
| 195 |
+
git push
|
| 196 |
+
```
|
| 197 |
+
|
| 198 |
+
### Need to revert git-xet
|
| 199 |
+
```bash
|
| 200 |
+
git xet uninstall
|
| 201 |
+
# Files in repos still work via LFS bridge (slower, but compatible)
|
| 202 |
+
```
|