prithivMLmods commited on
Commit
3c99ae4
·
verified ·
1 Parent(s): 688d66b

update app

Browse files
Files changed (1) hide show
  1. app.py +20 -20
app.py CHANGED
@@ -12,27 +12,27 @@ from transformers.image_utils import load_image
12
  from gradio.themes import Soft
13
  from gradio.themes.utils import colors, fonts, sizes
14
 
15
- colors.steel_blue = colors.Color(
16
- name="steel_blue",
17
- c50="#EBF3F8",
18
- c100="#D3E5F0",
19
- c200="#A8CCE1",
20
- c300="#7DB3D2",
21
- c400="#529AC3",
22
- c500="#4682B4",
23
- c600="#3E72A0",
24
- c700="#36638C",
25
- c800="#2E5378",
26
- c900="#264364",
27
- c950="#1E3450",
28
  )
29
 
30
- class SteelBlueTheme(Soft):
31
  def __init__(
32
  self,
33
  *,
34
  primary_hue: colors.Color | str = colors.gray,
35
- secondary_hue: colors.Color | str = colors.steel_blue,
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] = (
@@ -59,8 +59,8 @@ class SteelBlueTheme(Soft):
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_800)",
63
- button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_500)",
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)",
@@ -78,7 +78,7 @@ class SteelBlueTheme(Soft):
78
  block_label_background_fill="*primary_200",
79
  )
80
 
81
- steel_blue_theme = SteelBlueTheme()
82
 
83
  MODEL_PATH = "zai-org/GLM-OCR"
84
 
@@ -168,7 +168,7 @@ css = """
168
  with gr.Blocks() as demo:
169
 
170
  gr.Markdown("# **GLM-OCR**", elem_id="main-title")
171
- gr.Markdown("(multimodal OCR model for complex document understanding](https://huggingface.co/zai-org/GLM-OCR)", elem_id="subtitle")
172
 
173
  with gr.Row():
174
 
@@ -224,4 +224,4 @@ with gr.Blocks() as demo:
224
  )
225
 
226
  if __name__ == "__main__":
227
- demo.queue(max_size=50).launch(css=css, theme=steel_blue_theme, mcp_server=True, ssr_mode=False, show_error=True)
 
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,
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] = (
 
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)",
 
78
  block_label_background_fill="*primary_200",
79
  )
80
 
81
+ orange_red_theme = OrangeRedTheme()
82
 
83
  MODEL_PATH = "zai-org/GLM-OCR"
84
 
 
168
  with gr.Blocks() as demo:
169
 
170
  gr.Markdown("# **GLM-OCR**", elem_id="main-title")
171
+ gr.Markdown("[multimodal OCR model for complex document understanding](https://huggingface.co/zai-org/GLM-OCR)", elem_id="subtitle")
172
 
173
  with gr.Row():
174
 
 
224
  )
225
 
226
  if __name__ == "__main__":
227
+ demo.queue(max_size=50).launch(css=css, theme=OrangeRedTheme, mcp_server=True, ssr_mode=False, show_error=True)