lamiaaEl commited on
Commit
adcd7fc
·
verified ·
1 Parent(s): bb96ccd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -4,6 +4,11 @@ import streamlit as st
4
  from transformers import AutoModelForTokenClassification, AutoProcessor
5
  from PIL import Image, ImageDraw, ImageFont
6
 
 
 
 
 
 
7
  # Load the LayoutLMv3 model and processor
8
  processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=True)
9
  model = AutoModelForTokenClassification.from_pretrained("capitaletech/language-levels-LayoutLMv3-v4")
 
4
  from transformers import AutoModelForTokenClassification, AutoProcessor
5
  from PIL import Image, ImageDraw, ImageFont
6
 
7
+ import pytesseract
8
+
9
+ # If the executable is not found, set the path explicitly
10
+ pytesseract.pytesseract.tesseract_cmd = '/usr/bin/tesseract' # Adjust if necessary
11
+
12
  # Load the LayoutLMv3 model and processor
13
  processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=True)
14
  model = AutoModelForTokenClassification.from_pretrained("capitaletech/language-levels-LayoutLMv3-v4")