prithivMLmods commited on
Commit
eac47c7
·
verified ·
1 Parent(s): 713f243

update app

Browse files
Files changed (1) hide show
  1. app.py +20 -30
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 Red color palette
33
- colors.red_theme = colors.Color(
34
- name="red_theme",
35
- c50="#FFE5E5",
36
- c100="#FFCCCC",
37
- c200="#FF9999",
38
- c300="#FF6666",
39
- c400="#FF3333",
40
- c500="#FF0000", # Red base color
41
- c600="#D90000",
42
- c700="#B30000",
43
- c800="#8C0000",
44
- c900="#660000",
45
- c950="#400000",
46
  )
47
 
48
- colors.red_gray = colors.Color(
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.red_theme, # Use the new red color
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
- red_theme = RedTheme()
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 = 1024
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=red_theme, css=css) as demo:
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)", latex_delimiters=[
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"],