WINTER4000 commited on
Commit
f06f359
·
verified ·
1 Parent(s): 8d39e85

Revert gradio 5.x bump (HF Dockerfile forces 4.44); pin starlette+fastapi instead

Browse files
Files changed (1) hide show
  1. requirements.txt +29 -15
requirements.txt CHANGED
@@ -1,24 +1,38 @@
1
- # Gradio 5.x for ChatInterface in messages mode + Spaces ZeroGPU support.
2
  #
3
- # Why 5.x: Gradio 4.44 calls Starlette's TemplateResponse with the old
4
- # (name, context) signature. Starlette 0.37 (which fastapi >= 0.111
5
- # transitively pins) expects (request, name, context) — so the request
6
- # dict ends up being used as the template name, blowing up jinja2's
7
- # cache lookup with "TypeError: unhashable type: 'dict'" on every
8
- # request. Pinning jinja2 didn't help (the bug is upstream of jinja2).
9
- # Gradio 5.x adopted the new Starlette signature and fixes this.
10
- gradio>=5.0,<6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  spaces
12
 
13
- # Model loading + inference. Pinning major versions so a transformers
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
- # Quantization not strictly needed on the A100 (BioMistral-7B fits in
22
- # bf16 with 26 GB free) but kept in case we ever swap to a larger model
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