prithivMLmods commited on
Commit
5b3b978
·
verified ·
1 Parent(s): fba31e4

all model inference checks: passed ✅ (#1)

Browse files

- all model inference checks: passed ✅ (971bcfdc602a74e9f70bbc1f370f4710373b39e3)

Files changed (1) hide show
  1. app.py +33 -23
app.py CHANGED
@@ -25,27 +25,27 @@ from qwen_vl_utils import process_vision_info
25
  from gradio.themes import Soft
26
  from gradio.themes.utils import colors, fonts, sizes
27
 
28
- colors.steel_blue = colors.Color(
29
- name="steel_blue",
30
- c50="#EBF3F8",
31
- c100="#D3E5F0",
32
- c200="#A8CCE1",
33
- c300="#7DB3D2",
34
- c400="#529AC3",
35
- c500="#4682B4",
36
- c600="#3E72A0",
37
- c700="#36638C",
38
- c800="#2E5378",
39
- c900="#264364",
40
- c950="#1E3450",
41
  )
42
 
43
- class SteelBlueTheme(Soft):
44
  def __init__(
45
  self,
46
  *,
47
  primary_hue: colors.Color | str = colors.gray,
48
- secondary_hue: colors.Color | str = colors.steel_blue,
49
  neutral_hue: colors.Color | str = colors.slate,
50
  text_size: sizes.Size | str = sizes.text_lg,
51
  font: fonts.Font | str | Iterable[fonts.Font | str] = (
@@ -72,16 +72,26 @@ class SteelBlueTheme(Soft):
72
  button_primary_text_color_hover="white",
73
  button_primary_background_fill="linear-gradient(90deg, *secondary_500, *secondary_600)",
74
  button_primary_background_fill_hover="linear-gradient(90deg, *secondary_600, *secondary_700)",
75
- button_primary_background_fill_dark="linear-gradient(90deg, *secondary_600, *secondary_800)",
76
- button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_500)",
 
 
 
 
 
 
 
 
77
  block_title_text_weight="600",
78
  block_border_width="3px",
79
  block_shadow="*shadow_drop_lg",
80
  button_primary_shadow="*shadow_drop_lg",
81
  button_large_padding="11px",
 
 
82
  )
83
 
84
- steel_blue_theme = SteelBlueTheme()
85
 
86
  device = "cuda" if torch.cuda.is_available() else "cpu"
87
  print(f"Running on device: {device}")
@@ -406,7 +416,7 @@ css="""
406
  """
407
  with gr.Blocks() as demo:
408
  gr.Markdown("# **CUA GUI Operator 🖥️**", elem_id="main-title")
409
- gr.Markdown("Upload a screenshot, select a model, and provide a task. The model will determine the precise UI coordinates and actions.")
410
 
411
  with gr.Row():
412
  with gr.Column(scale=2):
@@ -439,13 +449,13 @@ with gr.Blocks() as demo:
439
 
440
  gr.Examples(
441
  examples=[
442
- ["examples/1.jpg", "Search for 'Hugging Face'", "Fara-7B"],
443
- ["examples/2.jpg", "Click on the VLMs Collection", "UI-TARS-1.5-7B"],
444
- ["examples/3.jpg", "Where is the 'I'm Feeling Lucky' button?", "Holo1-3B"],
445
  ],
446
  inputs=[input_image, task_input, model_choice],
447
  label="Quick Examples"
448
  )
449
 
450
  if __name__ == "__main__":
451
- demo.queue(max_size=50).launch(theme=steel_blue_theme, css=css, mcp_server=True, ssr_mode=False, show_error=True)
 
25
  from gradio.themes import Soft
26
  from gradio.themes.utils import colors, fonts, sizes
27
 
28
+ colors.orange_red = colors.Color(
29
+ name="orange_red",
30
+ c50="#FFF0E5",
31
+ c100="#FFE0CC",
32
+ c200="#FFC299",
33
+ c300="#FFA366",
34
+ c400="#FF8533",
35
+ c500="#FF4500",
36
+ c600="#E63E00",
37
+ c700="#CC3700",
38
+ c800="#B33000",
39
+ c900="#992900",
40
+ c950="#802200",
41
  )
42
 
43
+ class OrangeRedTheme(Soft):
44
  def __init__(
45
  self,
46
  *,
47
  primary_hue: colors.Color | str = colors.gray,
48
+ secondary_hue: colors.Color | str = colors.orange_red,
49
  neutral_hue: colors.Color | str = colors.slate,
50
  text_size: sizes.Size | str = sizes.text_lg,
51
  font: fonts.Font | str | Iterable[fonts.Font | str] = (
 
72
  button_primary_text_color_hover="white",
73
  button_primary_background_fill="linear-gradient(90deg, *secondary_500, *secondary_600)",
74
  button_primary_background_fill_hover="linear-gradient(90deg, *secondary_600, *secondary_700)",
75
+ button_primary_background_fill_dark="linear-gradient(90deg, *secondary_600, *secondary_700)",
76
+ button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_600)",
77
+ button_secondary_text_color="black",
78
+ button_secondary_text_color_hover="white",
79
+ button_secondary_background_fill="linear-gradient(90deg, *primary_300, *primary_300)",
80
+ button_secondary_background_fill_hover="linear-gradient(90deg, *primary_400, *primary_400)",
81
+ button_secondary_background_fill_dark="linear-gradient(90deg, *primary_500, *primary_600)",
82
+ button_secondary_background_fill_hover_dark="linear-gradient(90deg, *primary_500, *primary_500)",
83
+ slider_color="*secondary_500",
84
+ slider_color_dark="*secondary_600",
85
  block_title_text_weight="600",
86
  block_border_width="3px",
87
  block_shadow="*shadow_drop_lg",
88
  button_primary_shadow="*shadow_drop_lg",
89
  button_large_padding="11px",
90
+ color_accent_soft="*primary_100",
91
+ block_label_background_fill="*primary_200",
92
  )
93
 
94
+ orange_red_theme = OrangeRedTheme()
95
 
96
  device = "cuda" if torch.cuda.is_available() else "cpu"
97
  print(f"Running on device: {device}")
 
416
  """
417
  with gr.Blocks() as demo:
418
  gr.Markdown("# **CUA GUI Operator 🖥️**", elem_id="main-title")
419
+ gr.Markdown("Perform Computer Use Agent tasks with the models: [Fara-7B](https://huggingface.co/microsoft/Fara-7B), [UI-TARS-1.5-7B](https://huggingface.co/ByteDance-Seed/UI-TARS-1.5-7B), and [Holo](https://huggingface.co/Hcompany/Holo1-3B).")
420
 
421
  with gr.Row():
422
  with gr.Column(scale=2):
 
449
 
450
  gr.Examples(
451
  examples=[
452
+ ["examples/1.png", "Click on the Fara-7B model.", "Fara-7B"],
453
+ ["examples/2.png", "Click on the VLMs Collection", "UI-TARS-1.5-7B"],
454
+ ["examples/3.png", "Click on the 'Real-time vision models' collection.", "Holo1-3B"],
455
  ],
456
  inputs=[input_image, task_input, model_choice],
457
  label="Quick Examples"
458
  )
459
 
460
  if __name__ == "__main__":
461
+ demo.queue(max_size=50).launch(theme=orange_red_theme, css=css, mcp_server=True, ssr_mode=False, show_error=True)