Vinay15 commited on
Commit
3a5fa1a
·
verified ·
1 Parent(s): d74aaed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,9 +3,9 @@ from transformers import AutoTokenizer, AutoModelForImageClassification
3
  from PIL import Image
4
  import torch
5
 
6
- # Load the model and tokenizer
7
- tokenizer = AutoTokenizer.from_pretrained('ucaslcl/GOT-OCR2_0')
8
- model = AutoModelForImageClassification.from_pretrained('ucaslcl/GOT-OCR2_0')
9
 
10
  def perform_ocr(image):
11
  # Ensure the image is in the right format
 
3
  from PIL import Image
4
  import torch
5
 
6
+ # Load the model and tokenizer with trust_remote_code set to True
7
+ tokenizer = AutoTokenizer.from_pretrained('stepfun-ai/GOT-OCR2_0', trust_remote_code=True)
8
+ model = AutoModelForImageClassification.from_pretrained('stepfun-ai/GOT-OCR2_0', trust_remote_code=True)
9
 
10
  def perform_ocr(image):
11
  # Ensure the image is in the right format