Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ import cv2
|
|
| 10 |
from transformers import (
|
| 11 |
Qwen2_5_VLForConditionalGeneration,
|
| 12 |
Qwen2VLForConditionalGeneration,
|
| 13 |
-
Glm4vForConditionalGeneration,
|
| 14 |
AutoProcessor,
|
| 15 |
TextIteratorStreamer,
|
| 16 |
)
|
|
@@ -33,7 +33,7 @@ model_m = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
|
| 33 |
).to(device).eval()
|
| 34 |
|
| 35 |
# Load Megalodon-OCR-Sync-0713
|
| 36 |
-
MODEL_ID_T = "prithivMLmods/
|
| 37 |
processor_t = AutoProcessor.from_pretrained(MODEL_ID_T, trust_remote_code=True)
|
| 38 |
model_t = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 39 |
MODEL_ID_T,
|
|
@@ -92,7 +92,7 @@ def generate_image(model_name: str, text: str, image: Image.Image,
|
|
| 92 |
if model_name == "Camel-Doc-OCR-062825":
|
| 93 |
processor = processor_m
|
| 94 |
model = model_m
|
| 95 |
-
elif model_name == "
|
| 96 |
processor = processor_t
|
| 97 |
model = model_t
|
| 98 |
elif model_name == "Video-MTR":
|
|
@@ -148,7 +148,7 @@ def generate_video(model_name: str, text: str, video_path: str,
|
|
| 148 |
if model_name == "Camel-Doc-OCR-062825":
|
| 149 |
processor = processor_m
|
| 150 |
model = model_m
|
| 151 |
-
elif model_name == "
|
| 152 |
processor = processor_t
|
| 153 |
model = model_t
|
| 154 |
elif model_name == "Video-MTR":
|
|
@@ -268,14 +268,14 @@ 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", "Video-MTR", "
|
| 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("> [
|
| 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 |
|
|
|
|
| 10 |
from transformers import (
|
| 11 |
Qwen2_5_VLForConditionalGeneration,
|
| 12 |
Qwen2VLForConditionalGeneration,
|
| 13 |
+
#Glm4vForConditionalGeneration,
|
| 14 |
AutoProcessor,
|
| 15 |
TextIteratorStreamer,
|
| 16 |
)
|
|
|
|
| 33 |
).to(device).eval()
|
| 34 |
|
| 35 |
# Load Megalodon-OCR-Sync-0713
|
| 36 |
+
MODEL_ID_T = "prithivMLmods/Gliese-OCR-7B-Post1.0"
|
| 37 |
processor_t = AutoProcessor.from_pretrained(MODEL_ID_T, trust_remote_code=True)
|
| 38 |
model_t = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 39 |
MODEL_ID_T,
|
|
|
|
| 92 |
if model_name == "Camel-Doc-OCR-062825":
|
| 93 |
processor = processor_m
|
| 94 |
model = model_m
|
| 95 |
+
elif model_name == "Gliese-OCR-7B-Post1.0":
|
| 96 |
processor = processor_t
|
| 97 |
model = model_t
|
| 98 |
elif model_name == "Video-MTR":
|
|
|
|
| 148 |
if model_name == "Camel-Doc-OCR-062825":
|
| 149 |
processor = processor_m
|
| 150 |
model = model_m
|
| 151 |
+
elif model_name == "Gliese-OCR-7B-Post1.0":
|
| 152 |
processor = processor_t
|
| 153 |
model = model_t
|
| 154 |
elif model_name == "Video-MTR":
|
|
|
|
| 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", "Gliese-OCR-7B-Post1.0", "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("> [Gliese-OCR-7B-Post1.0](https://huggingface.co/prithivMLmods/Gliese-OCR-7B-Post1.0) is a fine-tuned version of Camel-Doc-OCR-062825, optimized for Document Retrieval, Content Extraction, and Analysis Recognition. Built on top of the Qwen2.5-VL architecture, this model enhances document comprehension capabilities.")
|
| 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 |
|