Spaces:
Running
on
Zero
Running
on
Zero
update app
Browse files
app.py
CHANGED
|
@@ -25,19 +25,28 @@ from transformers.image_utils import load_image
|
|
| 25 |
from gradio.themes import Soft
|
| 26 |
from gradio.themes.utils import colors, fonts, sizes
|
| 27 |
|
| 28 |
-
colors.
|
| 29 |
-
name="
|
| 30 |
-
c50="#
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
)
|
| 34 |
|
| 35 |
-
|
|
|
|
| 36 |
def __init__(
|
| 37 |
self,
|
| 38 |
*,
|
| 39 |
primary_hue: colors.Color | str = colors.gray,
|
| 40 |
-
secondary_hue: colors.Color | str = colors.
|
| 41 |
neutral_hue: colors.Color | str = colors.slate,
|
| 42 |
text_size: sizes.Size | str = sizes.text_lg,
|
| 43 |
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
|
@@ -60,10 +69,10 @@ class ThistleTheme(Soft):
|
|
| 60 |
background_fill_primary_dark="*primary_900",
|
| 61 |
body_background_fill="linear-gradient(135deg, *primary_200, *primary_100)",
|
| 62 |
body_background_fill_dark="linear-gradient(135deg, *primary_900, *primary_800)",
|
| 63 |
-
button_primary_text_color="
|
| 64 |
button_primary_text_color_hover="white",
|
| 65 |
-
button_primary_background_fill="linear-gradient(90deg, *
|
| 66 |
-
button_primary_background_fill_hover="linear-gradient(90deg, *secondary_600, *
|
| 67 |
button_primary_background_fill_dark="linear-gradient(90deg, *secondary_600, *secondary_800)",
|
| 68 |
button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_500)",
|
| 69 |
button_secondary_text_color="black",
|
|
@@ -72,7 +81,7 @@ class ThistleTheme(Soft):
|
|
| 72 |
button_secondary_background_fill_hover="linear-gradient(90deg, *primary_400, *primary_400)",
|
| 73 |
button_secondary_background_fill_dark="linear-gradient(90deg, *primary_500, *primary_600)",
|
| 74 |
button_secondary_background_fill_hover_dark="linear-gradient(90deg, *primary_500, *primary_500)",
|
| 75 |
-
slider_color="*
|
| 76 |
slider_color_dark="*secondary_600",
|
| 77 |
block_title_text_weight="600",
|
| 78 |
block_border_width="3px",
|
|
@@ -83,7 +92,7 @@ class ThistleTheme(Soft):
|
|
| 83 |
block_label_background_fill="*primary_200",
|
| 84 |
)
|
| 85 |
|
| 86 |
-
|
| 87 |
|
| 88 |
MAX_MAX_NEW_TOKENS = 2048
|
| 89 |
DEFAULT_MAX_NEW_TOKENS = 1024
|
|
@@ -275,7 +284,7 @@ css = """
|
|
| 275 |
"""
|
| 276 |
|
| 277 |
# Create the Gradio Interface
|
| 278 |
-
with gr.Blocks(css=css, theme=
|
| 279 |
gr.Markdown("# **Qwen3-VL-Outpost**", elem_id="main-title")
|
| 280 |
with gr.Row():
|
| 281 |
with gr.Column(scale=2):
|
|
@@ -287,7 +296,7 @@ with gr.Blocks(css=css, theme=thistle_theme) as demo:
|
|
| 287 |
gr.Examples(examples=image_examples, inputs=[image_query, image_upload])
|
| 288 |
|
| 289 |
with gr.TabItem("Video Inference"):
|
| 290 |
-
video_query = gr.Textbox(label="Query Input", placeholder="
|
| 291 |
video_upload = gr.Video(label="Video", height=290)
|
| 292 |
video_submit = gr.Button("Submit", variant="primary")
|
| 293 |
gr.Examples(examples=video_examples, inputs=[video_query, video_upload])
|
|
|
|
| 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 |
+
|
| 44 |
+
class SteelBlueTheme(Soft):
|
| 45 |
def __init__(
|
| 46 |
self,
|
| 47 |
*,
|
| 48 |
primary_hue: colors.Color | str = colors.gray,
|
| 49 |
+
secondary_hue: colors.Color | str = colors.steel_blue,
|
| 50 |
neutral_hue: colors.Color | str = colors.slate,
|
| 51 |
text_size: sizes.Size | str = sizes.text_lg,
|
| 52 |
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
|
|
|
| 69 |
background_fill_primary_dark="*primary_900",
|
| 70 |
body_background_fill="linear-gradient(135deg, *primary_200, *primary_100)",
|
| 71 |
body_background_fill_dark="linear-gradient(135deg, *primary_900, *primary_800)",
|
| 72 |
+
button_primary_text_color="white",
|
| 73 |
button_primary_text_color_hover="white",
|
| 74 |
+
button_primary_background_fill="linear-gradient(90deg, *secondary_500, *secondary_600)",
|
| 75 |
+
button_primary_background_fill_hover="linear-gradient(90deg, *secondary_600, *secondary_700)",
|
| 76 |
button_primary_background_fill_dark="linear-gradient(90deg, *secondary_600, *secondary_800)",
|
| 77 |
button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_500)",
|
| 78 |
button_secondary_text_color="black",
|
|
|
|
| 81 |
button_secondary_background_fill_hover="linear-gradient(90deg, *primary_400, *primary_400)",
|
| 82 |
button_secondary_background_fill_dark="linear-gradient(90deg, *primary_500, *primary_600)",
|
| 83 |
button_secondary_background_fill_hover_dark="linear-gradient(90deg, *primary_500, *primary_500)",
|
| 84 |
+
slider_color="*secondary_500",
|
| 85 |
slider_color_dark="*secondary_600",
|
| 86 |
block_title_text_weight="600",
|
| 87 |
block_border_width="3px",
|
|
|
|
| 92 |
block_label_background_fill="*primary_200",
|
| 93 |
)
|
| 94 |
|
| 95 |
+
steel_blue_theme = SteelBlueTheme()
|
| 96 |
|
| 97 |
MAX_MAX_NEW_TOKENS = 2048
|
| 98 |
DEFAULT_MAX_NEW_TOKENS = 1024
|
|
|
|
| 284 |
"""
|
| 285 |
|
| 286 |
# Create the Gradio Interface
|
| 287 |
+
with gr.Blocks(css=css, theme=steel_blue_theme) as demo:
|
| 288 |
gr.Markdown("# **Qwen3-VL-Outpost**", elem_id="main-title")
|
| 289 |
with gr.Row():
|
| 290 |
with gr.Column(scale=2):
|
|
|
|
| 296 |
gr.Examples(examples=image_examples, inputs=[image_query, image_upload])
|
| 297 |
|
| 298 |
with gr.TabItem("Video Inference"):
|
| 299 |
+
video_query = gr.Textbox(label="Query Input", placeholder="Enter your query here...")
|
| 300 |
video_upload = gr.Video(label="Video", height=290)
|
| 301 |
video_submit = gr.Button("Submit", variant="primary")
|
| 302 |
gr.Examples(examples=video_examples, inputs=[video_query, video_upload])
|