prithivMLmods commited on
Commit
15b057f
·
verified ·
1 Parent(s): d4d8951

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -70,6 +70,15 @@ model_f = Qwen2_5_VLForConditionalGeneration.from_pretrained(
70
  torch_dtype=torch.float16
71
  ).to(device).eval()
72
 
 
 
 
 
 
 
 
 
 
73
  def downsample_video(video_path):
74
  """
75
  Downsample a video to evenly spaced frames, returning each as a PIL image with its timestamp.
@@ -115,6 +124,9 @@ def generate_image(model_name: str, text: str, image: Image.Image,
115
  elif model_name == "OVR-7B-RL":
116
  processor = processor_f
117
  model = model_f
 
 
 
118
  else:
119
  yield "Invalid model selected.", "Invalid model selected."
120
  return
@@ -174,6 +186,9 @@ def generate_video(model_name: str, text: str, video_path: str,
174
  elif model_name == "OVR-7B-RL":
175
  processor = processor_f
176
  model = model_f
 
 
 
177
  else:
178
  yield "Invalid model selected.", "Invalid model selected."
179
  return
@@ -289,7 +304,7 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
289
  markdown_output = gr.Markdown(label="(Result.md)")
290
 
291
  model_choice = gr.Radio(
292
- choices=["Camel-Doc-OCR-062825", "GLM-4.1V-9B-Thinking", "Megalodon-OCR-Sync-0713", "MonkeyOCR-pro-1.2B", "OVR-7B-RL"],
293
  label="Select Model",
294
  value="Camel-Doc-OCR-062825"
295
  )
 
70
  torch_dtype=torch.float16
71
  ).to(device).eval()
72
 
73
+ # Load DeepEyes-7B
74
+ MODEL_ID_Y = "ChenShawn/DeepEyes-7B"
75
+ processor_y = AutoProcessor.from_pretrained(MODEL_ID_Y, trust_remote_code=True)
76
+ model_y = Qwen2_5_VLForConditionalGeneration.from_pretrained(
77
+ MODEL_ID_Y,
78
+ trust_remote_code=True,
79
+ torch_dtype=torch.float16
80
+ ).to(device).eval()
81
+
82
  def downsample_video(video_path):
83
  """
84
  Downsample a video to evenly spaced frames, returning each as a PIL image with its timestamp.
 
124
  elif model_name == "OVR-7B-RL":
125
  processor = processor_f
126
  model = model_f
127
+ elif model_name == "DeepEyes-7B-Thinking":
128
+ processor = processor_y
129
+ model = model_y
130
  else:
131
  yield "Invalid model selected.", "Invalid model selected."
132
  return
 
186
  elif model_name == "OVR-7B-RL":
187
  processor = processor_f
188
  model = model_f
189
+ elif model_name == "DeepEyes-7B-Thinking":
190
+ processor = processor_y
191
+ model = model_y
192
  else:
193
  yield "Invalid model selected.", "Invalid model selected."
194
  return
 
304
  markdown_output = gr.Markdown(label="(Result.md)")
305
 
306
  model_choice = gr.Radio(
307
+ choices=["Camel-Doc-OCR-062825", "GLM-4.1V-9B-Thinking", "Megalodon-OCR-Sync-0713", "MonkeyOCR-pro-1.2B", "DeepEyes-7B-Thinking", "OVR-7B-RL"],
308
  label="Select Model",
309
  value="Camel-Doc-OCR-062825"
310
  )