Revert gradio 5.x bump (HF Dockerfile forces 4.44); pin starlette+fastapi instead
Browse files- requirements.txt +29 -15
requirements.txt
CHANGED
|
@@ -1,24 +1,38 @@
|
|
| 1 |
-
#
|
| 2 |
#
|
| 3 |
-
#
|
| 4 |
-
#
|
| 5 |
-
#
|
| 6 |
-
#
|
| 7 |
-
#
|
| 8 |
-
#
|
| 9 |
-
#
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
spaces
|
| 12 |
|
| 13 |
-
# Model loading + inference.
|
| 14 |
-
# breaking change on HF can't silently nuke the Space at next rebuild.
|
| 15 |
transformers>=4.44,<5
|
| 16 |
-
torch>=2.3,<3
|
| 17 |
accelerate>=0.30
|
| 18 |
sentencepiece
|
| 19 |
protobuf
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
#
|
| 23 |
-
# or want to test bnb 4-bit memory wins locally.
|
| 24 |
bitsandbytes>=0.43
|
|
|
|
| 1 |
+
# NOTE for the next person debugging this file:
|
| 2 |
#
|
| 3 |
+
# HF Spaces ZeroGPU has a Dockerfile that INJECTS these versions on
|
| 4 |
+
# top of whatever's in this file:
|
| 5 |
+
#
|
| 6 |
+
# gradio[oauth]==4.44.0
|
| 7 |
+
# spaces==0.50.2
|
| 8 |
+
# torch<=2.11.0
|
| 9 |
+
# uvicorn>=0.14.0
|
| 10 |
+
#
|
| 11 |
+
# You cannot upgrade gradio past 4.44 on a ZeroGPU Space — pip will
|
| 12 |
+
# fail dependency resolution. Don't try (5467dbe / df84d94 already did
|
| 13 |
+
# and burned 30 min of rebuilds).
|
| 14 |
+
#
|
| 15 |
+
# Gradio 4.44 calls Starlette's TemplateResponse with the old
|
| 16 |
+
# positional signature (name, context). Starlette ≥ 0.38 raises
|
| 17 |
+
# `TypeError: unhashable type: 'dict'` at jinja2 cache lookup because
|
| 18 |
+
# it interprets the request as the template name. Pin starlette + the
|
| 19 |
+
# matching fastapi to the last versions that still tolerate the old
|
| 20 |
+
# signature.
|
| 21 |
+
|
| 22 |
+
# Pinned web stack that's known-compatible with Gradio 4.44.0:
|
| 23 |
+
fastapi>=0.111,<0.115
|
| 24 |
+
starlette>=0.37.2,<0.40
|
| 25 |
+
|
| 26 |
+
# Spaces SDK (the @spaces.GPU decorator). HF pins this too but
|
| 27 |
+
# declaring explicitly so we know the version we tested against.
|
| 28 |
spaces
|
| 29 |
|
| 30 |
+
# Model loading + inference.
|
|
|
|
| 31 |
transformers>=4.44,<5
|
|
|
|
| 32 |
accelerate>=0.30
|
| 33 |
sentencepiece
|
| 34 |
protobuf
|
| 35 |
|
| 36 |
+
# bitsandbytes is optional (BioMistral-7B fits in bf16 on A100 with
|
| 37 |
+
# room to spare). Kept for future swap to a larger model.
|
|
|
|
| 38 |
bitsandbytes>=0.43
|