Spaces:
Running
on
Zero
Running
on
Zero
all model inference checks: passed ✅ (#1)
Browse files- all model inference checks: passed ✅ (971bcfdc602a74e9f70bbc1f370f4710373b39e3)
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.
|
| 29 |
-
name="
|
| 30 |
-
c50="#
|
| 31 |
-
c100="#
|
| 32 |
-
c200="#
|
| 33 |
-
c300="#
|
| 34 |
-
c400="#
|
| 35 |
-
c500="#
|
| 36 |
-
c600="#
|
| 37 |
-
c700="#
|
| 38 |
-
c800="#
|
| 39 |
-
c900="#
|
| 40 |
-
c950="#
|
| 41 |
)
|
| 42 |
|
| 43 |
-
class
|
| 44 |
def __init__(
|
| 45 |
self,
|
| 46 |
*,
|
| 47 |
primary_hue: colors.Color | str = colors.gray,
|
| 48 |
-
secondary_hue: colors.Color | str = colors.
|
| 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, *
|
| 76 |
-
button_primary_background_fill_hover_dark="linear-gradient(90deg, *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 |
-
|
| 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("
|
| 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.
|
| 443 |
-
["examples/2.
|
| 444 |
-
["examples/3.
|
| 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=
|
|
|
|
| 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)
|