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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -77,9 +77,9 @@ model_g = Qwen2_5_VLForConditionalGeneration.from_pretrained(
77
  MODEL_ID_G, trust_remote_code=True, subfolder=SUBFOLDER, torch_dtype=torch.float16
78
  ).to(device).eval()
79
 
80
- MODEL_ID_I = "google/gemma-3-4b-it"
81
  processor_i = AutoProcessor.from_pretrained(MODEL_ID_I, trust_remote_code=True)
82
- model_i = Gemma3ForConditionalGeneration.from_pretrained(
83
  MODEL_ID_I, trust_remote_code=True, torch_dtype=torch.float16, _attn_implementation="flash_attention_2"
84
  ).to(device).eval()
85
 
@@ -178,7 +178,7 @@ def process_document_stream(
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.", ""
184
  return
@@ -235,7 +235,7 @@ def create_gradio_interface():
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")
 
77
  MODEL_ID_G, trust_remote_code=True, subfolder=SUBFOLDER, torch_dtype=torch.float16
78
  ).to(device).eval()
79
 
80
+ MODEL_ID_I = "HuggingFaceTB/SmolVLM2-2.2B-Instruct"
81
  processor_i = AutoProcessor.from_pretrained(MODEL_ID_I, trust_remote_code=True)
82
+ model_i = AutoModelForImageTextToText.from_pretrained(
83
  MODEL_ID_I, trust_remote_code=True, torch_dtype=torch.float16, _attn_implementation="flash_attention_2"
84
  ).to(device).eval()
85
 
 
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 == "SmolVLM2-2.2B-Instruct": processor, model = processor_i, model_i
182
  else:
183
  yield "Invalid model selected.", ""
184
  return
 
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", "SmolVLM2-2.2B-Instruct", "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")