Spaces:
Running
on
Zero
Running
on
Zero
update app
Browse files
app.py
CHANGED
|
@@ -30,35 +30,28 @@ from gradio.themes.utils import colors, fonts, sizes
|
|
| 30 |
|
| 31 |
# --- Theme and CSS Definition ---
|
| 32 |
|
| 33 |
-
# Define the
|
| 34 |
-
colors.
|
| 35 |
-
name="
|
| 36 |
-
c50="#
|
| 37 |
-
c100="#
|
| 38 |
-
c200="#
|
| 39 |
-
c300="#
|
| 40 |
-
c400="#
|
| 41 |
-
c500="#
|
| 42 |
-
c600="#
|
| 43 |
-
c700="#
|
| 44 |
-
c800="#
|
| 45 |
-
c900="#
|
| 46 |
-
c950="#
|
| 47 |
)
|
| 48 |
|
| 49 |
-
|
| 50 |
-
name="red_gray",
|
| 51 |
-
c50="#f7eded", c100="#f5dcdc", c200="#efb4b4", c300="#e78f8f",
|
| 52 |
-
c400="#d96a6a", c500="#c65353", c600="#b24444", c700="#8f3434",
|
| 53 |
-
c800="#732d2d", c900="#5f2626", c950="#4d2020",
|
| 54 |
-
)
|
| 55 |
-
|
| 56 |
-
class ThistleTheme(Soft):
|
| 57 |
def __init__(
|
| 58 |
self,
|
| 59 |
*,
|
| 60 |
primary_hue: colors.Color | str = colors.gray,
|
| 61 |
-
secondary_hue: colors.Color | str = colors.
|
| 62 |
neutral_hue: colors.Color | str = colors.slate,
|
| 63 |
text_size: sizes.Size | str = sizes.text_lg,
|
| 64 |
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
|
@@ -81,10 +74,10 @@ class ThistleTheme(Soft):
|
|
| 81 |
background_fill_primary_dark="*primary_900",
|
| 82 |
body_background_fill="linear-gradient(135deg, *primary_200, *primary_100)",
|
| 83 |
body_background_fill_dark="linear-gradient(135deg, *primary_900, *primary_800)",
|
| 84 |
-
button_primary_text_color="
|
| 85 |
button_primary_text_color_hover="white",
|
| 86 |
-
button_primary_background_fill="linear-gradient(90deg, *
|
| 87 |
-
button_primary_background_fill_hover="linear-gradient(90deg, *
|
| 88 |
button_primary_background_fill_dark="linear-gradient(90deg, *secondary_600, *secondary_700)",
|
| 89 |
button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_600)",
|
| 90 |
button_secondary_text_color="black",
|
|
@@ -93,7 +86,7 @@ class ThistleTheme(Soft):
|
|
| 93 |
button_secondary_background_fill_hover="linear-gradient(90deg, *primary_400, *primary_400)",
|
| 94 |
button_secondary_background_fill_dark="linear-gradient(90deg, *primary_500, *primary_600)",
|
| 95 |
button_secondary_background_fill_hover_dark="linear-gradient(90deg, *primary_500, *primary_500)",
|
| 96 |
-
slider_color="*
|
| 97 |
slider_color_dark="*secondary_600",
|
| 98 |
block_title_text_weight="600",
|
| 99 |
block_border_width="3px",
|
|
@@ -105,7 +98,7 @@ class ThistleTheme(Soft):
|
|
| 105 |
)
|
| 106 |
|
| 107 |
# Instantiate the new theme
|
| 108 |
-
|
| 109 |
|
| 110 |
css = """
|
| 111 |
#main-title h1 {
|
|
@@ -389,7 +382,7 @@ gif_examples = [["Describe this GIF.", "examples/gifs/1.gif"],
|
|
| 389 |
caption_examples = [["examples/captions/1.JPG"],
|
| 390 |
["examples/captions/2.jpeg"], ["examples/captions/3.jpeg"]]
|
| 391 |
|
| 392 |
-
with gr.Blocks(theme=
|
| 393 |
pdf_state = gr.State(value=get_initial_pdf_state())
|
| 394 |
gr.Markdown("# **Qwen-3VL:Multimodal**", elem_id="main-title")
|
| 395 |
with gr.Row():
|
|
|
|
| 30 |
|
| 31 |
# --- Theme and CSS Definition ---
|
| 32 |
|
| 33 |
+
# Define the new OrangeRed color palette
|
| 34 |
+
colors.orange_red = colors.Color(
|
| 35 |
+
name="orange_red",
|
| 36 |
+
c50="#FFF0E5",
|
| 37 |
+
c100="#FFE0CC",
|
| 38 |
+
c200="#FFC299",
|
| 39 |
+
c300="#FFA366",
|
| 40 |
+
c400="#FF8533",
|
| 41 |
+
c500="#FF4500", # OrangeRed base color
|
| 42 |
+
c600="#E63E00",
|
| 43 |
+
c700="#CC3700",
|
| 44 |
+
c800="#B33000",
|
| 45 |
+
c900="#992900",
|
| 46 |
+
c950="#802200",
|
| 47 |
)
|
| 48 |
|
| 49 |
+
class OrangeRedTheme(Soft):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
def __init__(
|
| 51 |
self,
|
| 52 |
*,
|
| 53 |
primary_hue: colors.Color | str = colors.gray,
|
| 54 |
+
secondary_hue: colors.Color | str = colors.orange_red, # Use the new color
|
| 55 |
neutral_hue: colors.Color | str = colors.slate,
|
| 56 |
text_size: sizes.Size | str = sizes.text_lg,
|
| 57 |
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
|
|
|
| 74 |
background_fill_primary_dark="*primary_900",
|
| 75 |
body_background_fill="linear-gradient(135deg, *primary_200, *primary_100)",
|
| 76 |
body_background_fill_dark="linear-gradient(135deg, *primary_900, *primary_800)",
|
| 77 |
+
button_primary_text_color="white",
|
| 78 |
button_primary_text_color_hover="white",
|
| 79 |
+
button_primary_background_fill="linear-gradient(90deg, *secondary_500, *secondary_600)",
|
| 80 |
+
button_primary_background_fill_hover="linear-gradient(90deg, *secondary_600, *secondary_700)",
|
| 81 |
button_primary_background_fill_dark="linear-gradient(90deg, *secondary_600, *secondary_700)",
|
| 82 |
button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_600)",
|
| 83 |
button_secondary_text_color="black",
|
|
|
|
| 86 |
button_secondary_background_fill_hover="linear-gradient(90deg, *primary_400, *primary_400)",
|
| 87 |
button_secondary_background_fill_dark="linear-gradient(90deg, *primary_500, *primary_600)",
|
| 88 |
button_secondary_background_fill_hover_dark="linear-gradient(90deg, *primary_500, *primary_500)",
|
| 89 |
+
slider_color="*secondary_500",
|
| 90 |
slider_color_dark="*secondary_600",
|
| 91 |
block_title_text_weight="600",
|
| 92 |
block_border_width="3px",
|
|
|
|
| 98 |
)
|
| 99 |
|
| 100 |
# Instantiate the new theme
|
| 101 |
+
orange_red_theme = OrangeRedTheme()
|
| 102 |
|
| 103 |
css = """
|
| 104 |
#main-title h1 {
|
|
|
|
| 382 |
caption_examples = [["examples/captions/1.JPG"],
|
| 383 |
["examples/captions/2.jpeg"], ["examples/captions/3.jpeg"]]
|
| 384 |
|
| 385 |
+
with gr.Blocks(theme=orange_red_theme, css=css) as demo:
|
| 386 |
pdf_state = gr.State(value=get_initial_pdf_state())
|
| 387 |
gr.Markdown("# **Qwen-3VL:Multimodal**", elem_id="main-title")
|
| 388 |
with gr.Row():
|