Vinay15 commited on
Commit
d396c6b
·
verified ·
1 Parent(s): 92fd7da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from transformers import AutoTokenizer, AutoModelForImageClassification
2
 
3
  def load_model_and_tokenizer():
4
  try:
@@ -10,7 +10,7 @@ def load_model_and_tokenizer():
10
  )
11
 
12
  # Load the model with the specific revision
13
- model = AutoModelForImageClassification.from_pretrained(
14
  'stepfun-ai/GOT-OCR2_0',
15
  revision='cf6b7386bc89a54f09785612ba74cb12de6fa17c', # Pin the specific revision
16
  trust_remote_code=True
@@ -28,4 +28,4 @@ if __name__ == "__main__":
28
  if model and tokenizer:
29
  print("Model and tokenizer loaded successfully!")
30
  else:
31
- print("Failed to load model and tokenizer.")
 
1
+ from transformers import AutoTokenizer, AutoModel
2
 
3
  def load_model_and_tokenizer():
4
  try:
 
10
  )
11
 
12
  # Load the model with the specific revision
13
+ model = AutoModel.from_pretrained(
14
  'stepfun-ai/GOT-OCR2_0',
15
  revision='cf6b7386bc89a54f09785612ba74cb12de6fa17c', # Pin the specific revision
16
  trust_remote_code=True
 
28
  if model and tokenizer:
29
  print("Model and tokenizer loaded successfully!")
30
  else:
31
+ print("Failed to load model and tokenizer.")