Spaces:
Running on Zero
Running on Zero
update app
Browse files
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.
|
| 16 |
-
name="
|
| 17 |
-
c50="#
|
| 18 |
-
c100="#
|
| 19 |
-
c200="#
|
| 20 |
-
c300="#
|
| 21 |
-
c400="#
|
| 22 |
-
c500="#
|
| 23 |
-
c600="#
|
| 24 |
-
c700="#
|
| 25 |
-
c800="#
|
| 26 |
-
c900="#
|
| 27 |
-
c950="#
|
| 28 |
)
|
| 29 |
|
| 30 |
-
class
|
| 31 |
def __init__(
|
| 32 |
self,
|
| 33 |
*,
|
| 34 |
primary_hue: colors.Color | str = colors.gray,
|
| 35 |
-
secondary_hue: colors.Color | str = colors.
|
| 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, *
|
| 63 |
-
button_primary_background_fill_hover_dark="linear-gradient(90deg, *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 |
-
|
| 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("
|
| 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=
|
|
|
|
| 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)
|