prithivMLmods commited on
Commit
c0c2d58
·
verified ·
1 Parent(s): 87719f9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -22,7 +22,6 @@ from transformers import (
22
  Qwen2_5_VLForConditionalGeneration,
23
  AutoModelForVision2Seq,
24
  AutoModelForImageTextToText,
25
- Gemma3ForConditionalGeneration,
26
  AutoModel,
27
  AutoProcessor,
28
  TextIteratorStreamer,
@@ -69,7 +68,7 @@ model_c = AutoModelForVision2Seq.from_pretrained(
69
  MODEL_ID_C, trust_remote_code=True, torch_dtype=torch.float16, _attn_implementation="flash_attention_2"
70
  ).to(device).eval()
71
 
72
- MODEL_ID_G = "echo840/MonkeyOCR"
73
  SUBFOLDER = "Recognition"
74
  processor_g = AutoProcessor.from_pretrained(
75
  MODEL_ID_G, trust_remote_code=True, subfolder=SUBFOLDER
@@ -178,7 +177,7 @@ def process_document_stream(
178
  if model_name == "LFM2-VL-450M": processor, model = processor_m, model_m
179
  elif model_name == "LFM2-VL-1.6B": processor, model = processor_t, model_t
180
  elif model_name == "SmolVLM-Instruct-250M": processor, model = processor_c, model_c
181
- elif model_name == "MonkeyOCR-Recognition": processor, model = processor_g, model_g
182
  elif model_name == "gemma-3-4b-it": processor, model = processor_i, model_i
183
  else:
184
  yield "Invalid model selected.", ""
@@ -236,7 +235,7 @@ def create_gradio_interface():
236
  # Left Column (Inputs)
237
  with gr.Column(scale=1):
238
  model_choice = gr.Dropdown(
239
- choices=["LFM2-VL-1.6B", "LFM2-VL-450M", "SmolVLM-Instruct-250M", "gemma-3-4b-it", "Megalodon-OCR-Sync-0713"],
240
  label="Select Model", value="LFM2-VL-1.6B"
241
  )
242
  prompt_input = gr.Textbox(label="Query Input", placeholder="✦︎ Enter your query")
 
22
  Qwen2_5_VLForConditionalGeneration,
23
  AutoModelForVision2Seq,
24
  AutoModelForImageTextToText,
 
25
  AutoModel,
26
  AutoProcessor,
27
  TextIteratorStreamer,
 
68
  MODEL_ID_C, trust_remote_code=True, torch_dtype=torch.float16, _attn_implementation="flash_attention_2"
69
  ).to(device).eval()
70
 
71
+ MODEL_ID_G = "echo840/MonkeyOCR-pro-1.2B"
72
  SUBFOLDER = "Recognition"
73
  processor_g = AutoProcessor.from_pretrained(
74
  MODEL_ID_G, trust_remote_code=True, subfolder=SUBFOLDER
 
177
  if model_name == "LFM2-VL-450M": processor, model = processor_m, model_m
178
  elif model_name == "LFM2-VL-1.6B": processor, model = processor_t, model_t
179
  elif model_name == "SmolVLM-Instruct-250M": processor, model = processor_c, model_c
180
+ elif model_name == "MonkeyOCR-pro-1.2B": processor, model = processor_g, model_g
181
  elif model_name == "gemma-3-4b-it": processor, model = processor_i, model_i
182
  else:
183
  yield "Invalid model selected.", ""
 
235
  # Left Column (Inputs)
236
  with gr.Column(scale=1):
237
  model_choice = gr.Dropdown(
238
+ choices=["LFM2-VL-1.6B", "LFM2-VL-450M", "SmolVLM-Instruct-250M", "gemma-3-4b-it", "MonkeyOCR-pro-1.2B"],
239
  label="Select Model", value="LFM2-VL-1.6B"
240
  )
241
  prompt_input = gr.Textbox(label="Query Input", placeholder="✦︎ Enter your query")