Spaces:
Running
on
Zero
Running
on
Zero
update app
#6
by
prithivMLmods
- opened
app.py
CHANGED
@@ -41,10 +41,10 @@ model_t = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
|
41 |
torch_dtype=torch.float16
|
42 |
).to(device).eval()
|
43 |
|
44 |
-
# Load
|
45 |
-
MODEL_ID_S = "
|
46 |
processor_s = AutoProcessor.from_pretrained(MODEL_ID_S, trust_remote_code=True)
|
47 |
-
model_s =
|
48 |
MODEL_ID_S,
|
49 |
trust_remote_code=True,
|
50 |
torch_dtype=torch.float16
|
@@ -95,7 +95,7 @@ def generate_image(model_name: str, text: str, image: Image.Image,
|
|
95 |
elif model_name == "Megalodon-OCR-Sync-0713":
|
96 |
processor = processor_t
|
97 |
model = model_t
|
98 |
-
elif model_name == "
|
99 |
processor = processor_s
|
100 |
model = model_s
|
101 |
elif model_name == "ViLaSR-7B":
|
@@ -151,7 +151,7 @@ def generate_video(model_name: str, text: str, video_path: str,
|
|
151 |
elif model_name == "Megalodon-OCR-Sync-0713":
|
152 |
processor = processor_t
|
153 |
model = model_t
|
154 |
-
elif model_name == "
|
155 |
processor = processor_s
|
156 |
model = model_s
|
157 |
elif model_name == "ViLaSR-7B":
|
@@ -268,15 +268,18 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
|
268 |
with gr.Accordion("(Result.md)", open=False):
|
269 |
markdown_output = gr.Markdown(label="(Result.md)")
|
270 |
model_choice = gr.Radio(
|
271 |
-
choices=["Camel-Doc-OCR-062825", "
|
272 |
label="Select Model",
|
273 |
value="Camel-Doc-OCR-062825"
|
274 |
)
|
275 |
gr.Markdown("**Model Info 💻** | [Report Bug](https://huggingface.co/spaces/prithivMLmods/Multimodal-VLM-v1.0/discussions)")
|
276 |
-
gr.Markdown("> [Camel-Doc-OCR-062825](https://huggingface.co/prithivMLmods/Camel-Doc-OCR-062825), [GLM-4.1V-9B-Thinking](https://huggingface.co/zai-org/GLM-4.1V-9B-Thinking), [Megalodon-OCR-Sync-0713](https://huggingface.co/prithivMLmods/Megalodon-OCR-Sync-0713), and [ViLaSR-7B](https://huggingface.co/inclusionAI/ViLaSR) are recent vision-language models excelling in document intelligence and multimodal understanding. Camel-Doc-OCR-062825 is a Qwen2.5-VL-7B-Instruct finetune, highly optimized for document retrieval, structured extraction, analysis, and direct Markdown generation from images and PDFs. GLM-4.1V-9B-Thinking offers next-level multimodal reasoning, bringing visual and textual comprehension together for advanced question answering.")
|
277 |
-
gr.Markdown("> Megalodon-OCR-Sync-0713, finetuned from Qwen2.5-VL-3B-Instruct, specializes in context-aware multimodal document extraction and analysis, excelling at retrieval, layout parsing, math, and chart/table recognition, with robust video and long-form comprehension capabilities. ViLaSR-7B focuses on reinforcing spatial reasoning in visual-language tasks by combining interwoven thinking with visual drawing, making it especially suited for spatial reasoning and complex tip-based queries.")
|
278 |
-
gr.Markdown("> ✋ ViLaSR-7B - demo only supports text-only reasoning, which doesn't reflect the full behavior of the model and may underrepresent its capabilities.")
|
279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
gr.Markdown("> ⚠️ Note: Models in this space may not perform well on video inference tasks.")
|
281 |
# Define the submit button actions
|
282 |
image_submit.click(fn=generate_image,
|
|
|
41 |
torch_dtype=torch.float16
|
42 |
).to(device).eval()
|
43 |
|
44 |
+
# Load Video-MTR
|
45 |
+
MODEL_ID_S = "Phoebe13/Video-MTR"
|
46 |
processor_s = AutoProcessor.from_pretrained(MODEL_ID_S, trust_remote_code=True)
|
47 |
+
model_s = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
48 |
MODEL_ID_S,
|
49 |
trust_remote_code=True,
|
50 |
torch_dtype=torch.float16
|
|
|
95 |
elif model_name == "Megalodon-OCR-Sync-0713":
|
96 |
processor = processor_t
|
97 |
model = model_t
|
98 |
+
elif model_name == "Video-MTR":
|
99 |
processor = processor_s
|
100 |
model = model_s
|
101 |
elif model_name == "ViLaSR-7B":
|
|
|
151 |
elif model_name == "Megalodon-OCR-Sync-0713":
|
152 |
processor = processor_t
|
153 |
model = model_t
|
154 |
+
elif model_name == "Video-MTR":
|
155 |
processor = processor_s
|
156 |
model = model_s
|
157 |
elif model_name == "ViLaSR-7B":
|
|
|
268 |
with gr.Accordion("(Result.md)", open=False):
|
269 |
markdown_output = gr.Markdown(label="(Result.md)")
|
270 |
model_choice = gr.Radio(
|
271 |
+
choices=["Camel-Doc-OCR-062825", "Video-MTR", "Megalodon-OCR-Sync-0713", "ViLaSR-7B"],
|
272 |
label="Select Model",
|
273 |
value="Camel-Doc-OCR-062825"
|
274 |
)
|
275 |
gr.Markdown("**Model Info 💻** | [Report Bug](https://huggingface.co/spaces/prithivMLmods/Multimodal-VLM-v1.0/discussions)")
|
|
|
|
|
|
|
276 |
|
277 |
+
gr.Markdown("> [Camel-Doc-OCR-062825](https://huggingface.co/prithivMLmods/Camel-Doc-OCR-062825) is a Qwen2.5-VL-7B-Instruct finetune, highly optimized for document retrieval, structured extraction, analysis, and direct Markdown generation from images and PDFs.")
|
278 |
+
gr.Markdown("> [Megalodon-OCR-Sync-0713](https://huggingface.co/prithivMLmods/Megalodon-OCR-Sync-0713), finetuned from Qwen2.5-VL-3B-Instruct, specializes in context-aware multimodal document extraction and analysis, excelling at retrieval, layout parsing, math, and chart/table recognition.")
|
279 |
+
gr.Markdown("> [ViLaSR-7B](https://huggingface.co/inclusionAI/ViLaSR) focuses on reinforcing spatial reasoning in visual-language tasks by combining interwoven thinking with visual drawing, making it especially suited for spatial reasoning and complex tip-based queries.")
|
280 |
+
gr.Markdown("> [Video-MTR](https://huggingface.co/Phoebe13/Video-MTR) introduces reinforced multi-turn reasoning for long-form video understanding, enabling iterative key segment selection and deeper question comprehension.")
|
281 |
+
|
282 |
+
gr.Markdown("> ✋ ViLaSR-7B - demo only supports text-only reasoning, which doesn't reflect the full behavior of the model and may underrepresent its capabilities.")
|
283 |
gr.Markdown("> ⚠️ Note: Models in this space may not perform well on video inference tasks.")
|
284 |
# Define the submit button actions
|
285 |
image_submit.click(fn=generate_image,
|