deepkick commited on
Commit
7b3a08d
·
1 Parent(s): 242f528

Resolve HF Spaces gradio version conflict

Browse files

HF Spaces builds its runtime based on README.md's sdk_version
frontmatter field and raises a version-conflict build error when
requirements.txt also lists gradio — sdk_version always wins on HF's
side and the conflict surfaces before pip is even invoked.

Two changes:
- README.md: sdk_version 4.44.1 -> 4.31.5 to match our intent
(4.44.1 ships gradio_client 1.3.0 with the jinja cache +
additionalProperties schema regressions we hit earlier).
- requirements.txt: drop the `gradio==4.31.5` line entirely so HF
only sees the sdk_version declaration. Kept the huggingface_hub
upper bound because gradio 4.x still imports HfFolder, which was
removed in huggingface_hub 1.0.

Local runs are unaffected: gradio 4.31.5 is still resolvable from
other installers.

Files changed (2) hide show
  1. README.md +1 -1
  2. requirements.txt +7 -6
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🔧
4
  colorFrom: blue
5
  colorTo: purple
6
  sdk: gradio
7
- sdk_version: 4.44.1
8
  python_version: "3.10"
9
  app_file: app.py
10
  pinned: false
 
4
  colorFrom: blue
5
  colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 4.31.5
8
  python_version: "3.10"
9
  app_file: app.py
10
  pinned: false
requirements.txt CHANGED
@@ -3,12 +3,13 @@ pydantic>=2.0
3
  networkx>=3.0
4
  Pillow>=10.0
5
  tqdm>=4.65
6
- # Pin to 4.31.5: 4.44.1 ships gradio_client 1.3.0 which has two bugs that
7
- # trip this app on HF Spaces (1) json_schema_to_python_type crashes on
8
- # bool additionalProperties values emitted by FileData/PlotData, and (2) a
9
- # jinja2 template cache issue raises "TypeError: unhashable type: 'dict'".
10
- # 4.31.5 ships gradio_client 0.16.4 which predates both.
11
- gradio==4.31.5
 
12
  # gradio 4.x imports HfFolder which was removed in huggingface_hub 1.0
13
  huggingface_hub>=0.26,<1.0
14
  matplotlib>=3.7
 
3
  networkx>=3.0
4
  Pillow>=10.0
5
  tqdm>=4.65
6
+ # gradio is intentionally NOT listed here: HF Spaces auto-installs the
7
+ # version declared in README.md's `sdk_version` frontmatter field, and
8
+ # listing it again in requirements.txt causes a version-conflict build
9
+ # error (HF forces sdk_version to win). Bump sdk_version in README.md
10
+ # to upgrade. See the repo README for the full rationale on why we pin
11
+ # to gradio 4.31.5 (gradio_client 1.3.0 regressions in 4.44.1).
12
+
13
  # gradio 4.x imports HfFolder which was removed in huggingface_hub 1.0
14
  huggingface_hub>=0.26,<1.0
15
  matplotlib>=3.7