multimodalart HF Staff commited on
Commit
c6aba7c
·
verified ·
1 Parent(s): b498e94

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +10 -5
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: ~28 tok/s decode, ~4 s of prefill and image
202
- # encoding per call. Sized to the observed worst case plus ~15%.
203
- return int(min(150, 10 + budget * 0.042))
 
 
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", theme=gr.themes.Citrus(), css=CSS) as demo:
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
- demo.queue(max_size=12).launch(mcp_server=True)
 
 
 
 
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
+ )