Maxim Kruglikov Claude Opus 4.7 (1M context) commited on
Commit
6b38433
·
1 Parent(s): 5d76f8c

Bump sdk_version to 5.50.0; drop gradio pin from requirements.txt

Browse files

HF injects gradio[oauth]==<sdk_version> into the pip install line, which
conflicts with an independent gradio pin in requirements.txt. The previous
push failed the build with that conflict. Fix by bumping sdk_version in
README frontmatter and removing the redundant requirements.txt line.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files changed (3) hide show
  1. CLAUDE.md +12 -7
  2. README.md +1 -1
  3. requirements.txt +3 -1
CLAUDE.md CHANGED
@@ -195,13 +195,18 @@ curl -s "https://huggingface.co/api/spaces/olfronar/megastyle-comparison" | \
195
  crashes at import. Vision-only inference has no use for the tokenizer. Load
196
  `SiglipImageProcessor.from_pretrained(SIGLIP_ID)` directly — the `pixel_values` output is
197
  identical.
198
- - **Pin `gradio>=5.25.0`, and launch with `show_api=False`.** HF's base image preinstalls
199
- `gradio==5.9.1`, which has a `gradio_client.utils.get_type` that can't handle boolean JSON
200
- schemas (valid JSON-Schema shorthand for accept-anything). `gr.Dataframe` triggers this path in
201
- `/api/info`, producing a flood of `TypeError: argument of type 'bool' is not iterable` in the
202
- run logs every time anything hits the API endpoint. Fixed in later 5.x. `show_api=False` on
203
- `launch()` is an additional guard that prevents the endpoint from being exposed at all — we
204
- don't need programmatic API access for a visual-only demo.
 
 
 
 
 
205
  - **Match upstream preprocessing exactly.** If you find yourself tempted to resize, center-crop, or
206
  change color-space conversion manually instead of going through the SigLIP image processor, stop
207
  — the metric will silently degrade.
 
195
  crashes at import. Vision-only inference has no use for the tokenizer. Load
196
  `SiglipImageProcessor.from_pretrained(SIGLIP_ID)` directly — the `pixel_values` output is
197
  identical.
198
+ - **Control the gradio version via `sdk_version` in README frontmatter, not `requirements.txt`.**
199
+ HF's Dockerfile injects `gradio[oauth]==<sdk_version>` into the pip install line alongside our
200
+ `requirements.txt`. Putting a conflicting `gradio` pin in `requirements.txt` (e.g.
201
+ `gradio>=5.25.0`) crashes the build with `Cannot install gradio==<sdk_version> and gradio>=...
202
+ because these package versions have conflicting dependencies`. Bump `sdk_version` instead;
203
+ `requirements.txt` should not name gradio at all.
204
+ - **`sdk_version: 5.50.0` or newer is required.** Gradio 5.9.1 (the version HF defaults to at
205
+ Space creation) ships a `gradio_client.utils.get_type` that crashes on boolean JSON schemas
206
+ (valid JSON-Schema shorthand for accept-anything). `gr.Dataframe` triggers this in `/api/info`,
207
+ flooding run logs with `TypeError: argument of type 'bool' is not iterable`. Fixed in later
208
+ 5.x. Also launch with `show_api=False` as a belt-and-suspenders so the endpoint isn't exposed
209
+ at all — we don't need programmatic API access for a visual-only demo.
210
  - **Match upstream preprocessing exactly.** If you find yourself tempted to resize, center-crop, or
211
  change color-space conversion manually instead of going through the SigLIP image processor, stop
212
  — the metric will silently degrade.
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🎨
4
  colorFrom: purple
5
  colorTo: pink
6
  sdk: gradio
7
- sdk_version: 5.9.1
8
  python_version: "3.10"
9
  app_file: app.py
10
  pinned: false
 
4
  colorFrom: purple
5
  colorTo: pink
6
  sdk: gradio
7
+ sdk_version: 5.50.0
8
  python_version: "3.10"
9
  app_file: app.py
10
  pinned: false
requirements.txt CHANGED
@@ -1,4 +1,6 @@
1
- gradio>=5.25.0
 
 
2
  torch>=2.1.0
3
  transformers>=4.45.0
4
  Pillow>=10.0.0
 
1
+ # gradio is pinned by the Space's `sdk_version` frontmatter (see README.md).
2
+ # Adding a gradio line here conflicts with HF's hardcoded `gradio==<sdk_version>`
3
+ # install. Bump the frontmatter instead.
4
  torch>=2.1.0
5
  transformers>=4.45.0
6
  Pillow>=10.0.0