Claude commited on
Commit
df925bf
·
unverified ·
1 Parent(s): 6e8f79b

Pin starlette<0.40 for gradio 4.44.0's old TemplateResponse signature

Browse files

Starlette 0.40 made `request` the first positional arg of
`TemplateResponse`, but gradio 4.44.0 still calls it with
`(name, context, ...)`. With a newer starlette the context dict
ends up in the `name` slot and Jinja2 raises
`TypeError: unhashable type: 'dict'` on every page load.

Pin starlette<0.40 (and fastapi<0.113 to keep its starlette dep in
range) so the HF Space can actually serve the UI until we upgrade
off gradio 4.44.0.

Files changed (1) hide show
  1. requirements.txt +9 -0
requirements.txt CHANGED
@@ -37,4 +37,13 @@ audioop-lts>=0.2.1; python_version >= "3.13"
37
  # huggingface-hub 0.30. Pin below that until we can upgrade Gradio.
38
  huggingface-hub>=0.23,<0.30
39
 
 
 
 
 
 
 
 
 
 
40
  # CUDA-Q is installed separately on the Space (see README).
 
37
  # huggingface-hub 0.30. Pin below that until we can upgrade Gradio.
38
  huggingface-hub>=0.23,<0.30
39
 
40
+ # Starlette 0.40 made `request` the first positional arg of
41
+ # `TemplateResponse`, but gradio 4.44.0 still calls it as
42
+ # `TemplateResponse(name, context, ...)`. With a newer starlette the
43
+ # context dict lands in the `name` slot and Jinja2 crashes with
44
+ # "unhashable type: 'dict'" the moment the UI is requested. Pin to the
45
+ # pre-break line; fastapi capped to match.
46
+ starlette<0.40
47
+ fastapi<0.113
48
+
49
  # CUDA-Q is installed separately on the Space (see README).