Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -32,6 +32,15 @@ model_m = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
|
32 |
torch_dtype=torch.float16
|
33 |
).to(device).eval()
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
# Load Megalodon-OCR-Sync-0713
|
36 |
MODEL_ID_T = "prithivMLmods/Megalodon-OCR-Sync-0713"
|
37 |
processor_t = AutoProcessor.from_pretrained(MODEL_ID_T, trust_remote_code=True)
|
@@ -101,6 +110,9 @@ def generate_image(model_name: str, text: str, image: Image.Image,
|
|
101 |
elif model_name == "DeepEyes-7B-Thinking":
|
102 |
processor = processor_y
|
103 |
model = model_y
|
|
|
|
|
|
|
104 |
else:
|
105 |
yield "Invalid model selected.", "Invalid model selected."
|
106 |
return
|
@@ -157,6 +169,9 @@ def generate_video(model_name: str, text: str, video_path: str,
|
|
157 |
elif model_name == "DeepEyes-7B-Thinking":
|
158 |
processor = processor_y
|
159 |
model = model_y
|
|
|
|
|
|
|
160 |
else:
|
161 |
yield "Invalid model selected.", "Invalid model selected."
|
162 |
return
|
@@ -272,7 +287,7 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
|
272 |
markdown_output = gr.Markdown(label="(Result.md)")
|
273 |
|
274 |
model_choice = gr.Radio(
|
275 |
-
choices=["Camel-Doc-OCR-062825", "GLM-4.1V-9B-Thinking", "Megalodon-OCR-Sync-0713", "DeepEyes-7B-Thinking"],
|
276 |
label="Select Model",
|
277 |
value="Camel-Doc-OCR-062825"
|
278 |
)
|
|
|
32 |
torch_dtype=torch.float16
|
33 |
).to(device).eval()
|
34 |
|
35 |
+
# Load VLM-R1-Qwen2.5VL-3B-OVD-0321
|
36 |
+
MODEL_ID_X = "omlab/VLM-R1-Qwen2.5VL-3B-OVD-0321"
|
37 |
+
processor_x = AutoProcessor.from_pretrained(MODEL_ID_X, trust_remote_code=True)
|
38 |
+
model_x = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
39 |
+
MODEL_ID_X,
|
40 |
+
trust_remote_code=True,
|
41 |
+
torch_dtype=torch.float16
|
42 |
+
).to(device).eval()
|
43 |
+
|
44 |
# Load Megalodon-OCR-Sync-0713
|
45 |
MODEL_ID_T = "prithivMLmods/Megalodon-OCR-Sync-0713"
|
46 |
processor_t = AutoProcessor.from_pretrained(MODEL_ID_T, trust_remote_code=True)
|
|
|
110 |
elif model_name == "DeepEyes-7B-Thinking":
|
111 |
processor = processor_y
|
112 |
model = model_y
|
113 |
+
elif model_name == "VLM-R1-Qwen2.5VL":
|
114 |
+
processor = processor_x
|
115 |
+
model = model_x
|
116 |
else:
|
117 |
yield "Invalid model selected.", "Invalid model selected."
|
118 |
return
|
|
|
169 |
elif model_name == "DeepEyes-7B-Thinking":
|
170 |
processor = processor_y
|
171 |
model = model_y
|
172 |
+
elif model_name == "VLM-R1-Qwen2.5VL":
|
173 |
+
processor = processor_x
|
174 |
+
model = model_x
|
175 |
else:
|
176 |
yield "Invalid model selected.", "Invalid model selected."
|
177 |
return
|
|
|
287 |
markdown_output = gr.Markdown(label="(Result.md)")
|
288 |
|
289 |
model_choice = gr.Radio(
|
290 |
+
choices=["Camel-Doc-OCR-062825", "GLM-4.1V-9B-Thinking", "Megalodon-OCR-Sync-0713", "DeepEyes-7B-Thinking", "VLM-R1-Qwen2.5VL"],
|
291 |
label="Select Model",
|
292 |
value="Camel-Doc-OCR-062825"
|
293 |
)
|