Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,7 @@ import cv2
|
|
15 |
|
16 |
from transformers import (
|
17 |
Qwen2_5_VLForConditionalGeneration,
|
|
|
18 |
Gemma3ForConditionalGeneration,
|
19 |
AutoProcessor,
|
20 |
TextIteratorStreamer,
|
@@ -38,7 +39,7 @@ model_m = Gemma3ForConditionalGeneration.from_pretrained(
|
|
38 |
).to(device).eval()
|
39 |
|
40 |
# Load DocScope
|
41 |
-
MODEL_ID_X = "prithivMLmods/
|
42 |
processor_x = AutoProcessor.from_pretrained(MODEL_ID_X, trust_remote_code=True)
|
43 |
model_x = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
44 |
MODEL_ID_X,
|
@@ -89,7 +90,7 @@ def generate_image(model_name: str, text: str, image: Image.Image,
|
|
89 |
if model_name == "gemma-3-4b-it":
|
90 |
processor = processor_m
|
91 |
model = model_m
|
92 |
-
elif model_name == "
|
93 |
processor = processor_x
|
94 |
model = model_x
|
95 |
elif model_name == "Captioner-7B":
|
@@ -245,7 +246,7 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
|
245 |
with gr.Column():
|
246 |
output = gr.Textbox(label="Output", interactive=False, lines=2, scale=2)
|
247 |
model_choice = gr.Radio(
|
248 |
-
choices=["gemma-3-4b-it", "
|
249 |
label="Select Model",
|
250 |
value="gemma-3-4b-it"
|
251 |
)
|
|
|
15 |
|
16 |
from transformers import (
|
17 |
Qwen2_5_VLForConditionalGeneration,
|
18 |
+
Qwen2VLForConditionalGeneration,
|
19 |
Gemma3ForConditionalGeneration,
|
20 |
AutoProcessor,
|
21 |
TextIteratorStreamer,
|
|
|
39 |
).to(device).eval()
|
40 |
|
41 |
# Load DocScope
|
42 |
+
MODEL_ID_X = "prithivMLmods/coreOCR-7B-050325-preview"
|
43 |
processor_x = AutoProcessor.from_pretrained(MODEL_ID_X, trust_remote_code=True)
|
44 |
model_x = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
45 |
MODEL_ID_X,
|
|
|
90 |
if model_name == "gemma-3-4b-it":
|
91 |
processor = processor_m
|
92 |
model = model_m
|
93 |
+
elif model_name == "coreOCR-7B-050325-preview":
|
94 |
processor = processor_x
|
95 |
model = model_x
|
96 |
elif model_name == "Captioner-7B":
|
|
|
246 |
with gr.Column():
|
247 |
output = gr.Textbox(label="Output", interactive=False, lines=2, scale=2)
|
248 |
model_choice = gr.Radio(
|
249 |
+
choices=["gemma-3-4b-it", "coreOCR-7B-050325-preview", "Captioner-7B"],
|
250 |
label="Select Model",
|
251 |
value="gemma-3-4b-it"
|
252 |
)
|