Spaces:
Running
on
Zero
Running
on
Zero
update app
Browse files
app.py
CHANGED
|
@@ -29,35 +29,28 @@ from gradio.themes.utils import colors, fonts, sizes
|
|
| 29 |
|
| 30 |
# --- Theme and CSS Definition ---
|
| 31 |
|
| 32 |
-
# Define the new
|
| 33 |
-
colors.
|
| 34 |
-
name="
|
| 35 |
-
c50="#
|
| 36 |
-
c100="#
|
| 37 |
-
c200="#
|
| 38 |
-
c300="#
|
| 39 |
-
c400="#
|
| 40 |
-
c500="#
|
| 41 |
-
c600="#
|
| 42 |
-
c700="#
|
| 43 |
-
c800="#
|
| 44 |
-
c900="#
|
| 45 |
-
c950="#
|
| 46 |
)
|
| 47 |
|
| 48 |
-
|
| 49 |
-
name="red_gray",
|
| 50 |
-
c50="#f7eded", c100="#f5dcdc", c200="#efb4b4", c300="#e78f8f",
|
| 51 |
-
c400="#d96a6a", c500="#c65353", c600="#b24444", c700="#8f3434",
|
| 52 |
-
c800="#732d2d", c900="#5f2626", c950="#4d2020",
|
| 53 |
-
)
|
| 54 |
-
|
| 55 |
-
class RedTheme(Soft):
|
| 56 |
def __init__(
|
| 57 |
self,
|
| 58 |
*,
|
| 59 |
primary_hue: colors.Color | str = colors.gray,
|
| 60 |
-
secondary_hue: colors.Color | str = colors.
|
| 61 |
neutral_hue: colors.Color | str = colors.slate,
|
| 62 |
text_size: sizes.Size | str = sizes.text_lg,
|
| 63 |
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
|
@@ -104,7 +97,7 @@ class RedTheme(Soft):
|
|
| 104 |
)
|
| 105 |
|
| 106 |
# Instantiate the new theme
|
| 107 |
-
|
| 108 |
|
| 109 |
css = """
|
| 110 |
#main-title h1 {
|
|
@@ -116,7 +109,7 @@ css = """
|
|
| 116 |
"""
|
| 117 |
|
| 118 |
MAX_MAX_NEW_TOKENS = 4096
|
| 119 |
-
DEFAULT_MAX_NEW_TOKENS =
|
| 120 |
MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
| 121 |
|
| 122 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
@@ -318,7 +311,7 @@ video_examples = [
|
|
| 318 |
["Explain the ad in detail.", "videos/1.mp4"]
|
| 319 |
]
|
| 320 |
|
| 321 |
-
with gr.Blocks(theme=
|
| 322 |
gr.Markdown("# **Multimodal VLM Thinking**", elem_id="main-title")
|
| 323 |
with gr.Row():
|
| 324 |
with gr.Column(scale=2):
|
|
@@ -345,10 +338,7 @@ with gr.Blocks(theme=red_theme, css=css) as demo:
|
|
| 345 |
gr.Markdown("## Output", elem_id="output-title")
|
| 346 |
output = gr.Textbox(label="Raw Output Stream", interactive=False, lines=11, show_copy_button=True)
|
| 347 |
with gr.Accordion("(Result.md)", open=False):
|
| 348 |
-
markdown_output = gr.Markdown(label="(Result.Md)"
|
| 349 |
-
{"left": "$$", "right": "$$", "display": True},
|
| 350 |
-
{"left": "$", "right": "$", "display": False}
|
| 351 |
-
])
|
| 352 |
|
| 353 |
model_choice = gr.Radio(
|
| 354 |
choices=["Lumian-VLR-7B-Thinking", "VisionThink-Efficient", "openbmb/MiniCPM-V-4", "Typhoon-OCR-3B", "olmOCR-7B-0225-preview"],
|
|
|
|
| 29 |
|
| 30 |
# --- Theme and CSS Definition ---
|
| 31 |
|
| 32 |
+
# Define the new SteelBlue color palette
|
| 33 |
+
colors.steel_blue = colors.Color(
|
| 34 |
+
name="steel_blue",
|
| 35 |
+
c50="#EBF3F8",
|
| 36 |
+
c100="#D3E5F0",
|
| 37 |
+
c200="#A8CCE1",
|
| 38 |
+
c300="#7DB3D2",
|
| 39 |
+
c400="#529AC3",
|
| 40 |
+
c500="#4682B4", # SteelBlue base color
|
| 41 |
+
c600="#3E72A0",
|
| 42 |
+
c700="#36638C",
|
| 43 |
+
c800="#2E5378",
|
| 44 |
+
c900="#264364",
|
| 45 |
+
c950="#1E3450",
|
| 46 |
)
|
| 47 |
|
| 48 |
+
class SteelBlueTheme(Soft):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
def __init__(
|
| 50 |
self,
|
| 51 |
*,
|
| 52 |
primary_hue: colors.Color | str = colors.gray,
|
| 53 |
+
secondary_hue: colors.Color | str = colors.steel_blue, # Use the new color
|
| 54 |
neutral_hue: colors.Color | str = colors.slate,
|
| 55 |
text_size: sizes.Size | str = sizes.text_lg,
|
| 56 |
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
|
|
|
| 97 |
)
|
| 98 |
|
| 99 |
# Instantiate the new theme
|
| 100 |
+
steel_blue_theme = SteelBlueTheme()
|
| 101 |
|
| 102 |
css = """
|
| 103 |
#main-title h1 {
|
|
|
|
| 109 |
"""
|
| 110 |
|
| 111 |
MAX_MAX_NEW_TOKENS = 4096
|
| 112 |
+
DEFAULT_MAX_NEW_TOKENS = 2048
|
| 113 |
MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
| 114 |
|
| 115 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
|
|
| 311 |
["Explain the ad in detail.", "videos/1.mp4"]
|
| 312 |
]
|
| 313 |
|
| 314 |
+
with gr.Blocks(theme=steel_blue_theme, css=css) as demo:
|
| 315 |
gr.Markdown("# **Multimodal VLM Thinking**", elem_id="main-title")
|
| 316 |
with gr.Row():
|
| 317 |
with gr.Column(scale=2):
|
|
|
|
| 338 |
gr.Markdown("## Output", elem_id="output-title")
|
| 339 |
output = gr.Textbox(label="Raw Output Stream", interactive=False, lines=11, show_copy_button=True)
|
| 340 |
with gr.Accordion("(Result.md)", open=False):
|
| 341 |
+
markdown_output = gr.Markdown(label="(Result.Md)")
|
|
|
|
|
|
|
|
|
|
| 342 |
|
| 343 |
model_choice = gr.Radio(
|
| 344 |
choices=["Lumian-VLR-7B-Thinking", "VisionThink-Efficient", "openbmb/MiniCPM-V-4", "Typhoon-OCR-3B", "olmOCR-7B-0225-preview"],
|