Update app.py
Browse files
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('
|
8 |
-
model = AutoModelForImageClassification.from_pretrained('
|
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
|