Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -97,6 +97,12 @@ model_x = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
|
97 |
MODEL_ID_X, trust_remote_code=True, torch_dtype=torch.float16
|
98 |
).to(device).eval()
|
99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
# --- PDF Generation and Preview Utility Function ---
|
101 |
def generate_and_preview_pdf(image: Image.Image, text_content: str, font_size: int, line_spacing: float, alignment: str, image_size: str):
|
102 |
"""
|
@@ -189,6 +195,7 @@ def process_document_stream(
|
|
189 |
|
190 |
if model_name == "LFM2-VL-450M": processor, model = processor_m, model_m
|
191 |
elif model_name == "LFM2-VL-1.6B": processor, model = processor_t, model_t
|
|
|
192 |
elif model_name == "SmolVLM-Instruct-250M": processor, model = processor_c, model_c
|
193 |
elif model_name == "MonkeyOCR-pro-1.2B": processor, model = processor_g, model_g
|
194 |
elif model_name == "VLAA-Thinker-Qwen2VL-2B": processor, model = processor_i, model_i
|
@@ -250,7 +257,7 @@ def create_gradio_interface():
|
|
250 |
# Left Column (Inputs)
|
251 |
with gr.Column(scale=1):
|
252 |
model_choice = gr.Dropdown(
|
253 |
-
choices=["LFM2-VL-1.6B", "LFM2-VL-450M", "SmolVLM-Instruct-250M", "Megalodon-OCR-Sync-0713", "VLAA-Thinker-Qwen2VL-2B", "MonkeyOCR-pro-1.2B",
|
254 |
"Nanonets-OCR-s"],
|
255 |
label="Select Model", value="LFM2-VL-1.6B"
|
256 |
)
|
|
|
97 |
MODEL_ID_X, trust_remote_code=True, torch_dtype=torch.float16
|
98 |
).to(device).eval()
|
99 |
|
100 |
+
MODEL_ID_Z = "Vchitect/ShotVL-3B"
|
101 |
+
processor_z = AutoProcessor.from_pretrained(MODEL_ID_Z, trust_remote_code=True)
|
102 |
+
model_z = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
103 |
+
MODEL_ID_Z, trust_remote_code=True, torch_dtype=torch.float16
|
104 |
+
).to(device).eval()
|
105 |
+
|
106 |
# --- PDF Generation and Preview Utility Function ---
|
107 |
def generate_and_preview_pdf(image: Image.Image, text_content: str, font_size: int, line_spacing: float, alignment: str, image_size: str):
|
108 |
"""
|
|
|
195 |
|
196 |
if model_name == "LFM2-VL-450M": processor, model = processor_m, model_m
|
197 |
elif model_name == "LFM2-VL-1.6B": processor, model = processor_t, model_t
|
198 |
+
elif model_name == "ShotVL-3B": processor, model = processor_z, model_z
|
199 |
elif model_name == "SmolVLM-Instruct-250M": processor, model = processor_c, model_c
|
200 |
elif model_name == "MonkeyOCR-pro-1.2B": processor, model = processor_g, model_g
|
201 |
elif model_name == "VLAA-Thinker-Qwen2VL-2B": processor, model = processor_i, model_i
|
|
|
257 |
# Left Column (Inputs)
|
258 |
with gr.Column(scale=1):
|
259 |
model_choice = gr.Dropdown(
|
260 |
+
choices=["LFM2-VL-1.6B", "LFM2-VL-450M", "SmolVLM-Instruct-250M", "ShotVL-3B", "Megalodon-OCR-Sync-0713", "VLAA-Thinker-Qwen2VL-2B", "MonkeyOCR-pro-1.2B",
|
261 |
"Nanonets-OCR-s"],
|
262 |
label="Select Model", value="LFM2-VL-1.6B"
|
263 |
)
|