prithivMLmods commited on
Commit
df4e947
·
verified ·
1 Parent(s): ee2dfd6

update app

Browse files
Files changed (1) hide show
  1. app.py +73 -2
app.py CHANGED
@@ -5,6 +5,77 @@ import spaces
5
  from molmo_utils import process_vision_info
6
  from typing import Iterable
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  MODEL_ID = "allenai/SAGE-MM-Qwen3-VL-4B-SFT_RL"
9
 
10
  print(f"Loading {MODEL_ID}...")
@@ -86,7 +157,7 @@ css = """
86
  #main-title h1 {font-size: 2.3em !important;}
87
  """
88
 
89
- with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="indigo", neutral_hue="slate"), css=css) as demo:
90
  gr.Markdown("# **SAGE-MM-Video-Reasoning 🎥**", elem_id="main-title")
91
  gr.Markdown("Upload a video to get a detailed explanation or ask specific questions using [SAGE-MM-Qwen3-VL](https://huggingface.co/allenai/SAGE-MM-Qwen3-VL-4B-SFT_RL).")
92
 
@@ -136,4 +207,4 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="indigo",
136
  )
137
 
138
  if __name__ == "__main__":
139
- demo.launch(mcp_server=True, ssr_mode=False)
 
5
  from molmo_utils import process_vision_info
6
  from typing import Iterable
7
 
8
+ from gradio.themes import Soft
9
+ from gradio.themes.utils import colors, fonts, sizes
10
+
11
+ colors.orange_red = colors.Color(
12
+ name="orange_red",
13
+ c50="#FFF0E5",
14
+ c100="#FFE0CC",
15
+ c200="#FFC299",
16
+ c300="#FFA366",
17
+ c400="#FF8533",
18
+ c500="#FF4500",
19
+ c600="#E63E00",
20
+ c700="#CC3700",
21
+ c800="#B33000",
22
+ c900="#992900",
23
+ c950="#802200",
24
+ )
25
+
26
+ class OrangeRedTheme(Soft):
27
+ def __init__(
28
+ self,
29
+ *,
30
+ primary_hue: colors.Color | str = colors.gray,
31
+ secondary_hue: colors.Color | str = colors.orange_red, # Use the new color
32
+ neutral_hue: colors.Color | str = colors.slate,
33
+ text_size: sizes.Size | str = sizes.text_lg,
34
+ font: fonts.Font | str | Iterable[fonts.Font | str] = (
35
+ fonts.GoogleFont("Outfit"), "Arial", "sans-serif",
36
+ ),
37
+ font_mono: fonts.Font | str | Iterable[fonts.Font | str] = (
38
+ fonts.GoogleFont("IBM Plex Mono"), "ui-monospace", "monospace",
39
+ ),
40
+ ):
41
+ super().__init__(
42
+ primary_hue=primary_hue,
43
+ secondary_hue=secondary_hue,
44
+ neutral_hue=neutral_hue,
45
+ text_size=text_size,
46
+ font=font,
47
+ font_mono=font_mono,
48
+ )
49
+ super().set(
50
+ background_fill_primary="*primary_50",
51
+ background_fill_primary_dark="*primary_900",
52
+ body_background_fill="linear-gradient(135deg, *primary_200, *primary_100)",
53
+ body_background_fill_dark="linear-gradient(135deg, *primary_900, *primary_800)",
54
+ button_primary_text_color="white",
55
+ button_primary_text_color_hover="white",
56
+ button_primary_background_fill="linear-gradient(90deg, *secondary_500, *secondary_600)",
57
+ button_primary_background_fill_hover="linear-gradient(90deg, *secondary_600, *secondary_700)",
58
+ button_primary_background_fill_dark="linear-gradient(90deg, *secondary_600, *secondary_700)",
59
+ button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_600)",
60
+ button_secondary_text_color="black",
61
+ button_secondary_text_color_hover="white",
62
+ button_secondary_background_fill="linear-gradient(90deg, *primary_300, *primary_300)",
63
+ button_secondary_background_fill_hover="linear-gradient(90deg, *primary_400, *primary_400)",
64
+ button_secondary_background_fill_dark="linear-gradient(90deg, *primary_500, *primary_600)",
65
+ button_secondary_background_fill_hover_dark="linear-gradient(90deg, *primary_500, *primary_500)",
66
+ slider_color="*secondary_500",
67
+ slider_color_dark="*secondary_600",
68
+ block_title_text_weight="600",
69
+ block_border_width="3px",
70
+ block_shadow="*shadow_drop_lg",
71
+ button_primary_shadow="*shadow_drop_lg",
72
+ button_large_padding="11px",
73
+ color_accent_soft="*primary_100",
74
+ block_label_background_fill="*primary_200",
75
+ )
76
+
77
+ orange_red_theme = OrangeRedTheme()
78
+
79
  MODEL_ID = "allenai/SAGE-MM-Qwen3-VL-4B-SFT_RL"
80
 
81
  print(f"Loading {MODEL_ID}...")
 
157
  #main-title h1 {font-size: 2.3em !important;}
158
  """
159
 
160
+ with gr.Blocks() as demo:
161
  gr.Markdown("# **SAGE-MM-Video-Reasoning 🎥**", elem_id="main-title")
162
  gr.Markdown("Upload a video to get a detailed explanation or ask specific questions using [SAGE-MM-Qwen3-VL](https://huggingface.co/allenai/SAGE-MM-Qwen3-VL-4B-SFT_RL).")
163
 
 
207
  )
208
 
209
  if __name__ == "__main__":
210
+ demo.launch(theme=orange_red_theme, mcp_server=True, ssr_mode=False)