Genzo1010 commited on
Commit
4cb1fb3
·
verified ·
1 Parent(s): c83da9d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -9,7 +9,9 @@ import io
9
  app = FastAPI()
10
 
11
  # Load the doctr OCR model
12
- ocr_model = ocr_predictor(pretrained=True)
 
 
13
 
14
  def ocr_with_doctr(file):
15
  text_output = ''
 
9
  app = FastAPI()
10
 
11
  # Load the doctr OCR model
12
+ os.environ['USE_TORCH'] = 'YES'
13
+ os.environ['USE_TF'] = 'NO'
14
+ ocr_model = ocr_predictor(det_arch='db_resnet50', reco_arch='crnn_vgg16_bn', pretrained=True).to(device)
15
 
16
  def ocr_with_doctr(file):
17
  text_output = ''