Spaces:
Running on Zero
Running on Zero
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -198,9 +198,11 @@ def _duration(screenshot, instruction, previous_actions="", enable_thinking=True
|
|
| 198 |
budget = int(max_new_tokens)
|
| 199 |
except (TypeError, ValueError):
|
| 200 |
budget = 768
|
| 201 |
-
# Measured on the live Space: ~
|
| 202 |
-
#
|
| 203 |
-
|
|
|
|
|
|
|
| 204 |
|
| 205 |
|
| 206 |
@spaces.GPU(duration=_duration)
|
|
@@ -353,7 +355,7 @@ CSS = """
|
|
| 353 |
.dark .gradio-container { color: var(--body-text-color); }
|
| 354 |
"""
|
| 355 |
|
| 356 |
-
with gr.Blocks(title="UI-Mate-9B"
|
| 357 |
gr.Markdown(
|
| 358 |
"""
|
| 359 |
# 🖱️ UI-Mate-9B — next GUI action from a screenshot
|
|
@@ -448,4 +450,7 @@ with gr.Blocks(title="UI-Mate-9B", theme=gr.themes.Citrus(), css=CSS) as demo:
|
|
| 448 |
)
|
| 449 |
|
| 450 |
if __name__ == "__main__":
|
| 451 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
budget = int(max_new_tokens)
|
| 199 |
except (TypeError, ValueError):
|
| 200 |
budget = 768
|
| 201 |
+
# Measured on the live Space: ~3.5 s of prefill + image encoding and ~42
|
| 202 |
+
# tok/s decode (6.9-8.6 s for 130-220-token replies on 1920x1080 frames).
|
| 203 |
+
# Sized to that rate plus cold-worker weight streaming and a small margin,
|
| 204 |
+
# deliberately tight so the visitor's ZeroGPU quota check stays cheap.
|
| 205 |
+
return int(min(90, 12 + budget * 0.028))
|
| 206 |
|
| 207 |
|
| 208 |
@spaces.GPU(duration=_duration)
|
|
|
|
| 355 |
.dark .gradio-container { color: var(--body-text-color); }
|
| 356 |
"""
|
| 357 |
|
| 358 |
+
with gr.Blocks(title="UI-Mate-9B") as demo:
|
| 359 |
gr.Markdown(
|
| 360 |
"""
|
| 361 |
# 🖱️ UI-Mate-9B — next GUI action from a screenshot
|
|
|
|
| 450 |
)
|
| 451 |
|
| 452 |
if __name__ == "__main__":
|
| 453 |
+
# Gradio 6 moved `theme` / `css` from the Blocks constructor to launch().
|
| 454 |
+
demo.queue(max_size=12).launch(
|
| 455 |
+
theme=gr.themes.Citrus(), css=CSS, mcp_server=True
|
| 456 |
+
)
|