Deploy MODUS 3-tab any-to-any demo (ZeroGPU)
Browse files- README.md +1 -1
- demo_modus.py +1 -1
- requirements.txt +9 -24
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 🎨
|
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 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=
|
| 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 |
-
#
|
| 4 |
-
#
|
| 5 |
-
#
|
| 6 |
-
#
|
| 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
|
| 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
|
| 38 |
-
#
|
| 39 |
-
#
|
| 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). ---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|