prithivMLmods commited on
Commit
c0d8624
·
verified ·
1 Parent(s): a71db69

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -59,10 +59,10 @@ model_g = Qwen2_5_VLForConditionalGeneration.from_pretrained(
59
  torch_dtype=torch.float16
60
  ).to(device).eval()
61
 
62
- # Load NuExtract-2.0-2B
63
- MODEL_ID_L = "numind/NuExtract-2.0-2B"
64
  processor_l = AutoProcessor.from_pretrained(MODEL_ID_L, trust_remote_code=True)
65
- model_l = Qwen2VLForConditionalGeneration.from_pretrained(
66
  MODEL_ID_L,
67
  trust_remote_code=True,
68
  torch_dtype=torch.float16
@@ -143,7 +143,7 @@ def generate_image(model_name: str, text: str, image: Image.Image,
143
  elif model_name == "SmolDocling-256M-preview":
144
  processor = processor_x
145
  model = model_x
146
- elif model_name == "NuExtract-2.0-2B":
147
  processor = processor_l
148
  model = model_l
149
  else:
@@ -230,7 +230,7 @@ def generate_video(model_name: str, text: str, video_path: str,
230
  elif model_name == "SmolDocling-256M-preview":
231
  processor = processor_x
232
  model = model_x
233
- elif model_name == "NuExtract-2.0-2B":
234
  processor = processor_l
235
  model = model_l
236
  else:
@@ -353,7 +353,7 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
353
  with gr.Column():
354
  output = gr.Textbox(label="Output", interactive=False, lines=3, scale=2)
355
  model_choice = gr.Radio(
356
- choices=["Nanonets-OCR-s", "SmolDocling-256M-preview", "MonkeyOCR-Recognition", "NuExtract-2.0-2B"],
357
  label="Select Model",
358
  value="Nanonets-OCR-s"
359
  )
 
59
  torch_dtype=torch.float16
60
  ).to(device).eval()
61
 
62
+ # Load typhoon-ocr-7b
63
+ MODEL_ID_L = "scb10x/typhoon-ocr-7b"
64
  processor_l = AutoProcessor.from_pretrained(MODEL_ID_L, trust_remote_code=True)
65
+ model_l = Qwen2_5_VLForConditionalGeneration.from_pretrained(
66
  MODEL_ID_L,
67
  trust_remote_code=True,
68
  torch_dtype=torch.float16
 
143
  elif model_name == "SmolDocling-256M-preview":
144
  processor = processor_x
145
  model = model_x
146
+ elif model_name == "typhoon-ocr-7b":
147
  processor = processor_l
148
  model = model_l
149
  else:
 
230
  elif model_name == "SmolDocling-256M-preview":
231
  processor = processor_x
232
  model = model_x
233
+ elif model_name == "typhoon-ocr-7b":
234
  processor = processor_l
235
  model = model_l
236
  else:
 
353
  with gr.Column():
354
  output = gr.Textbox(label="Output", interactive=False, lines=3, scale=2)
355
  model_choice = gr.Radio(
356
+ choices=["Nanonets-OCR-s", "SmolDocling-256M-preview", , "typhoon-ocr-7b", "MonkeyOCR-Recognition"],
357
  label="Select Model",
358
  value="Nanonets-OCR-s"
359
  )