imperiusrex commited on
Commit
1fa50f0
·
verified ·
1 Parent(s): 9d1511c

Fix: TrOCR model ID and numpy version

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -10,10 +10,10 @@ from paddleocr import PaddleOCR # Ensure paddleocr is installed and its dependen
10
  # --- Global Model Loading ---
11
  # Load the pre-trained TrOCR model and processor from Hugging Face Hub
12
  # IMPORTANT: Replace "your-username/my-handwritten-trocr" with your actual model's repository ID
13
- # If your model is also under 'imperiusrex', it would be "imperiusrex/my-handwritten-trocr"
14
  try:
15
- processor = TrOCRProcessor.from_pretrained("your-username/my-handwritten-trocr")
16
- model = VisionEncoderDecoderModel.from_pretrained("your-username/my-handwritten-trocr")
17
  model.eval() # Set model to evaluation mode
18
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
19
  model.to(device)
 
10
  # --- Global Model Loading ---
11
  # Load the pre-trained TrOCR model and processor from Hugging Face Hub
12
  # IMPORTANT: Replace "your-username/my-handwritten-trocr" with your actual model's repository ID
13
+ # For example, if you pushed your model to 'imperiusrex/my-handwritten-trocr', use that ID below.
14
  try:
15
+ processor = TrOCRProcessor.from_pretrained("imperiusrex/my-handwritten-trocr") # <--- UPDATED THIS LINE
16
+ model = VisionEncoderDecoderModel.from_pretrained("imperiusrex/my-handwritten-trocr") # <--- UPDATED THIS LINE
17
  model.eval() # Set model to evaluation mode
18
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
19
  model.to(device)