mamungtai-sat pormungtai commited on
Commit
369d427
·
1 Parent(s): 5788c76

Revert to modern Gradio (5.9.1) + keep bool-schema monkeypatch (#5)

Browse files

- Revert to modern Gradio (5.9.1) + keep bool-schema monkeypatch (4cdf360cfd12b09ae39ba127489792d0f2d19b2e)


Co-authored-by: pormungtailaw <pormungtai@users.noreply.huggingface.co>

Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +2 -2
  3. requirements.txt +8 -10
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🎭
4
  colorFrom: blue
5
  colorTo: indigo
6
  sdk: gradio
7
- sdk_version: 4.44.1
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
 
4
  colorFrom: blue
5
  colorTo: indigo
6
  sdk: gradio
7
+ sdk_version: 5.9.1
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
app.py CHANGED
@@ -29,10 +29,10 @@ def _safe_get_type(schema):
29
  _gcu.get_type = _safe_get_type
30
 
31
  _orig_j2pt = _gcu._json_schema_to_python_type
32
- def _safe_j2pt(schema, defs=None):
33
  if isinstance(schema, bool):
34
  return "Any"
35
- return _orig_j2pt(schema, defs)
36
  _gcu._json_schema_to_python_type = _safe_j2pt
37
 
38
  import pipeline_manager as pm
 
29
  _gcu.get_type = _safe_get_type
30
 
31
  _orig_j2pt = _gcu._json_schema_to_python_type
32
+ def _safe_j2pt(schema, *args, **kwargs):
33
  if isinstance(schema, bool):
34
  return "Any"
35
+ return _orig_j2pt(schema, *args, **kwargs)
36
  _gcu._json_schema_to_python_type = _safe_j2pt
37
 
38
  import pipeline_manager as pm
requirements.txt CHANGED
@@ -1,18 +1,16 @@
1
  # ZeroGPU provides the CUDA torch build; do not pin torch hard.
2
- # Coherent "gradio 4.44.1 era" (Sept-Oct 2024) version set known-good on ZeroGPU.
3
- # gradio itself is installed by HF from the README `sdk_version` field (4.44.1);
4
- # do NOT add a `gradio` line here or it conflicts with the Spaces runtime.
5
  spaces
6
  torch
7
  torchvision
8
- diffusers==0.31.0
9
- transformers==4.44.2
10
- accelerate==0.34.2
11
- peft==0.13.2
12
  safetensors>=0.4.3
13
- # gradio 4.44.1 imports HfFolder/whoami from huggingface_hub (removed in newer hub),
14
- # so pin hub to the matching era.
15
- huggingface_hub==0.25.2
16
  sentencepiece
17
  protobuf
18
  Pillow
 
1
  # ZeroGPU provides the CUDA torch build; do not pin torch hard.
2
+ # Modern set paired with a recent Gradio (installed by HF from README `sdk_version`).
3
+ # Do NOT add a `gradio` line here; it conflicts with the Spaces runtime.
4
+ # The api_info "bool is not iterable" bug is handled by a monkeypatch in app.py.
5
  spaces
6
  torch
7
  torchvision
8
+ diffusers>=0.31.0
9
+ transformers>=4.44.0
10
+ accelerate>=0.33.0
11
+ peft>=0.12.0
12
  safetensors>=0.4.3
13
+ huggingface_hub>=0.25.0
 
 
14
  sentencepiece
15
  protobuf
16
  Pillow