Fix: pin gradio>=6.0.0 to resolve HfFolder import error on Python 3.13
Browse filesgradio<6 uses HfFolder which was removed in huggingface_hub>=1.0.
Also adds import check step to dev loop in CLAUDE.md to catch this locally.
- CLAUDE.md +8 -4
- requirements.txt +1 -1
CLAUDE.md
CHANGED
|
@@ -9,17 +9,21 @@ Stack: Python · Gradio · diffusers · HuggingFace Spaces (ZeroGPU).
|
|
| 9 |
```
|
| 10 |
1. CODE → edit files
|
| 11 |
2. SYNTAX → ~/miniforge3/bin/python3 -c "import ast; [ast.parse(open(f).read()) for f in ['app.py','image_generator.py','math_engine.py']]"
|
| 12 |
-
3.
|
|
|
|
|
|
|
| 13 |
pkill -f "python3 app.py"; ~/miniforge3/bin/python3 app.py > /tmp/numzoo.log 2>&1 &
|
| 14 |
sleep 10 && cat /tmp/numzoo.log # must show no errors
|
| 15 |
-
|
| 16 |
arch -arm64 /bin/zsh -c "source ~/.nvm/nvm.sh && nvm use 20 && cd /Users/uplab/projects/puppeteer && node test_lovemath.mjs"
|
| 17 |
→ take screenshots, read them, verify visually
|
| 18 |
-
|
| 19 |
-
|
| 20 |
git add -A && git commit -m "..." && git push origin main
|
| 21 |
```
|
| 22 |
|
|
|
|
|
|
|
| 23 |
**Never push broken code.** If Puppeteer tests fail, do not proceed to push.
|
| 24 |
|
| 25 |
## Key files
|
|
|
|
| 9 |
```
|
| 10 |
1. CODE → edit files
|
| 11 |
2. SYNTAX → ~/miniforge3/bin/python3 -c "import ast; [ast.parse(open(f).read()) for f in ['app.py','image_generator.py','math_engine.py']]"
|
| 12 |
+
3. IMPORT → ~/miniforge3/bin/python3 -c "import app" 2>&1 # catches version conflicts & bad imports
|
| 13 |
+
must produce NO errors (warnings OK)
|
| 14 |
+
4. RUN → kill previous instance, start fresh:
|
| 15 |
pkill -f "python3 app.py"; ~/miniforge3/bin/python3 app.py > /tmp/numzoo.log 2>&1 &
|
| 16 |
sleep 10 && cat /tmp/numzoo.log # must show no errors
|
| 17 |
+
5. TEST → run Puppeteer (arm64 Node):
|
| 18 |
arch -arm64 /bin/zsh -c "source ~/.nvm/nvm.sh && nvm use 20 && cd /Users/uplab/projects/puppeteer && node test_lovemath.mjs"
|
| 19 |
→ take screenshots, read them, verify visually
|
| 20 |
+
6. FIX → if any step fails, fix and restart from step 1
|
| 21 |
+
7. PUSH → only when all steps pass:
|
| 22 |
git add -A && git commit -m "..." && git push origin main
|
| 23 |
```
|
| 24 |
|
| 25 |
+
**Version pinning rule:** always pin `gradio>=6.0.0` — older Gradio uses `HfFolder` which was removed from `huggingface_hub>=1.0`. Step 3 (import check) will catch this class of error locally.
|
| 26 |
+
|
| 27 |
**Never push broken code.** If Puppeteer tests fail, do not proceed to push.
|
| 28 |
|
| 29 |
## Key files
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
gradio>=
|
| 2 |
audioop-lts
|
| 3 |
diffusers>=0.30.0
|
| 4 |
transformers>=4.44.0
|
|
|
|
| 1 |
+
gradio>=6.0.0
|
| 2 |
audioop-lts
|
| 3 |
diffusers>=0.30.0
|
| 4 |
transformers>=4.44.0
|