prithivMLmods commited on
Commit
1ca682d
·
verified ·
1 Parent(s): d266b37

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +72 -1
app.py CHANGED
@@ -9,6 +9,77 @@ import os
9
  from molmo_utils import process_vision_info
10
  import spaces
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  MODEL_ID = "allenai/Molmo2-4B"
13
 
14
  print(f"Loading {MODEL_ID}...")
@@ -310,4 +381,4 @@ with gr.Blocks(title="Molmo2-4B Demo") as demo:
310
  )
311
 
312
  if __name__ == "__main__":
313
- demo.launch(server_name="0.0.0.0", share=True)
 
9
  from molmo_utils import process_vision_info
10
  import spaces
11
 
12
+ from gradio.themes import Soft
13
+ from gradio.themes.utils import colors, fonts, sizes
14
+
15
+ colors.orange_red = colors.Color(
16
+ name="orange_red",
17
+ c50="#FFF0E5",
18
+ c100="#FFE0CC",
19
+ c200="#FFC299",
20
+ c300="#FFA366",
21
+ c400="#FF8533",
22
+ c500="#FF4500",
23
+ c600="#E63E00",
24
+ c700="#CC3700",
25
+ c800="#B33000",
26
+ c900="#992900",
27
+ c950="#802200",
28
+ )
29
+
30
+ class OrangeRedTheme(Soft):
31
+ def __init__(
32
+ self,
33
+ *,
34
+ primary_hue: colors.Color | str = colors.gray,
35
+ secondary_hue: colors.Color | str = colors.orange_red, # Use the new color
36
+ neutral_hue: colors.Color | str = colors.slate,
37
+ text_size: sizes.Size | str = sizes.text_lg,
38
+ font: fonts.Font | str | Iterable[fonts.Font | str] = (
39
+ fonts.GoogleFont("Outfit"), "Arial", "sans-serif",
40
+ ),
41
+ font_mono: fonts.Font | str | Iterable[fonts.Font | str] = (
42
+ fonts.GoogleFont("IBM Plex Mono"), "ui-monospace", "monospace",
43
+ ),
44
+ ):
45
+ super().__init__(
46
+ primary_hue=primary_hue,
47
+ secondary_hue=secondary_hue,
48
+ neutral_hue=neutral_hue,
49
+ text_size=text_size,
50
+ font=font,
51
+ font_mono=font_mono,
52
+ )
53
+ super().set(
54
+ background_fill_primary="*primary_50",
55
+ background_fill_primary_dark="*primary_900",
56
+ body_background_fill="linear-gradient(135deg, *primary_200, *primary_100)",
57
+ body_background_fill_dark="linear-gradient(135deg, *primary_900, *primary_800)",
58
+ button_primary_text_color="white",
59
+ button_primary_text_color_hover="white",
60
+ button_primary_background_fill="linear-gradient(90deg, *secondary_500, *secondary_600)",
61
+ button_primary_background_fill_hover="linear-gradient(90deg, *secondary_600, *secondary_700)",
62
+ button_primary_background_fill_dark="linear-gradient(90deg, *secondary_600, *secondary_700)",
63
+ button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_600)",
64
+ button_secondary_text_color="black",
65
+ button_secondary_text_color_hover="white",
66
+ button_secondary_background_fill="linear-gradient(90deg, *primary_300, *primary_300)",
67
+ button_secondary_background_fill_hover="linear-gradient(90deg, *primary_400, *primary_400)",
68
+ button_secondary_background_fill_dark="linear-gradient(90deg, *primary_500, *primary_600)",
69
+ button_secondary_background_fill_hover_dark="linear-gradient(90deg, *primary_500, *primary_500)",
70
+ slider_color="*secondary_500",
71
+ slider_color_dark="*secondary_600",
72
+ block_title_text_weight="600",
73
+ block_border_width="3px",
74
+ block_shadow="*shadow_drop_lg",
75
+ button_primary_shadow="*shadow_drop_lg",
76
+ button_large_padding="11px",
77
+ color_accent_soft="*primary_100",
78
+ block_label_background_fill="*primary_200",
79
+ )
80
+
81
+ orange_red_theme = OrangeRedTheme()
82
+
83
  MODEL_ID = "allenai/Molmo2-4B"
84
 
85
  print(f"Loading {MODEL_ID}...")
 
381
  )
382
 
383
  if __name__ == "__main__":
384
+ demo.launch(theme=orange_red_theme, css=css, mcp_server=True, ssr_mode=False, show_error=True)