mqye commited on
Commit
36dbeb1
·
1 Parent(s): 3c2ac35

Deploy MODUS 3-tab any-to-any demo (ZeroGPU)

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. demo_modus.py +1 -1
  3. requirements.txt +9 -24
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🎨
4
  colorFrom: indigo
5
  colorTo: purple
6
  sdk: gradio
7
- sdk_version: 4.44.1
8
  app_file: app.py
9
  pinned: false
10
  short_description: MODUS any-to-any multimodal demo (16 aligned modalities)
 
4
  colorFrom: indigo
5
  colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 5.12.0
8
  app_file: app.py
9
  pinned: false
10
  short_description: MODUS any-to-any multimodal demo (16 aligned modalities)
demo_modus.py CHANGED
@@ -557,7 +557,7 @@ def build_ui() -> gr.Blocks:
557
  if ex:
558
  gr.Examples(ex, inputs=t1_image, label="Example images")
559
  with gr.Column():
560
- t1_gallery = gr.Gallery(label="Results", columns=[4])
561
  t1_status = gr.Markdown()
562
  t1_cond.change(_toggle_condition_input, t1_cond, [t1_image, t1_text])
563
  t1_btn.click(
 
557
  if ex:
558
  gr.Examples(ex, inputs=t1_image, label="Example images")
559
  with gr.Column():
560
+ t1_gallery = gr.Gallery(label="Results", columns=4)
561
  t1_status = gr.Markdown()
562
  t1_cond.change(_toggle_condition_input, t1_cond, [t1_image, t1_text])
563
  t1_btn.click(
requirements.txt CHANGED
@@ -1,22 +1,14 @@
1
  # MODUS demo — HF ZeroGPU Space requirements.
2
  #
3
- # NOTE: the versions that passed the cluster dry-run are ARM / nvidia-container
4
- # builds (torch 2.6 nv24.12, pycocotools nv, flash-attn 2.4.2 for GH200). HF
5
- # ZeroGPU is x86 + H200, so torch/flash-attn are pinned to standard x86 wheels
6
- # below and MAY need adjustment after reading the first Space build log.
7
-
8
- # ZeroGPU runtime helper (provides @spaces.GPU). Not installed on the cluster.
9
  spaces
10
-
11
- # --- web stack (verified working with the demo; keep these pins) ---
12
- gradio==4.44.1
13
- gradio-client==1.3.0
14
- fastapi==0.112.2
15
- starlette==0.38.6
16
- jinja2==3.1.4
17
 
18
  # --- HF / model stack ---
19
- huggingface-hub>=0.26,<1.0 # >=0.26 for `spaces`; <1.0 for gradio 4.44 compat
20
  transformers==4.46.2
21
  accelerate==1.1.1
22
  safetensors==0.4.5
@@ -34,13 +26,6 @@ scikit-learn==1.7.2
34
  pyyaml==6.0.3
35
  tqdm==4.67.1
36
 
37
- # --- torch/torchvision: the ZeroGPU base image ships a CUSTOM torch (2.11.0) with
38
- # NO matching torchvision wheel; installing torchvision downgrades torch to a
39
- # vanilla build and breaks ZeroGPU. So we do NOT install either — torch comes
40
- # from the base image and data/transforms.py was patched to be torchvision-free. ---
41
-
42
- # --- flash-attn: HARD top-level import in modeling/bagel/{qwen2_navit,siglip_navit}.py.
43
- # Must match the Space torch/CUDA/python. Use a prebuilt wheel; building from
44
- # source on the Space has no nvcc and will fail. Adjust the version/URL after
45
- # the first build log tells you the Space's torch+cu+cp tags. Example:
46
- # flash-attn==2.6.3
 
1
  # MODUS demo — HF ZeroGPU Space requirements.
2
  #
3
+ # gradio >= 5.12 is REQUIRED for ZeroGPU to attribute a logged-in / PRO user's
4
+ # quota from the browser (older gradio does not forward the user's ZeroGPU token,
5
+ # so every browser request falls back to the tiny anonymous tier). Let gradio pull
6
+ # its own matching gradio-client / fastapi / starlette / jinja2.
 
 
7
  spaces
8
+ gradio==5.12.0
 
 
 
 
 
 
9
 
10
  # --- HF / model stack ---
11
+ huggingface-hub>=0.26,<1.0
12
  transformers==4.46.2
13
  accelerate==1.1.1
14
  safetensors==0.4.5
 
26
  pyyaml==6.0.3
27
  tqdm==4.67.1
28
 
29
+ # --- torch/torchvision: provided by the ZeroGPU base image (custom torch 2.11);
30
+ # do NOT install (a pip torchvision would downgrade torch and break ZeroGPU).
31
+ # data/transforms.py is torchvision-free. No flash-attn (SDPA fallback). ---