virendravaishnav commited on
Commit
4fc61d2
·
1 Parent(s): ee363c7

Updated with OCR model and Gradio integration

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,10 +1,10 @@
1
  import gradio as gr
2
  from transformers import AutoTokenizer, AutoModelForVision2Seq
3
 
4
- # Load the tokenizer and model
5
  model_name = "OpenGVLab/InternVL2-1B"
6
- tokenizer = AutoTokenizer.from_pretrained(model_name)
7
- model = AutoModelForVision2Seq.from_pretrained(model_name)
8
 
9
  def analyze_image_text(image, text):
10
  # Tokenize the input
 
1
  import gradio as gr
2
  from transformers import AutoTokenizer, AutoModelForVision2Seq
3
 
4
+ # Load the tokenizer and model, trusting remote code
5
  model_name = "OpenGVLab/InternVL2-1B"
6
+ tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
7
+ model = AutoModelForVision2Seq.from_pretrained(model_name, trust_remote_code=True)
8
 
9
  def analyze_image_text(image, text):
10
  # Tokenize the input