Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,11 +13,7 @@ from pdf2image import convert_from_path
|
|
13 |
import torch
|
14 |
import os
|
15 |
# Ensure Poppler is installed
|
16 |
-
|
17 |
-
if not os.path.exists("/usr/bin/pdftoppm"): # Check if Poppler is installed
|
18 |
-
st.warning("Installing Poppler for PDF processing...")
|
19 |
-
subprocess.run(["apt-get", "update"])
|
20 |
-
subprocess.run(["apt-get", "install", "-y", "poppler-utils"])
|
21 |
|
22 |
# Load the OCR model
|
23 |
tokenizer = AutoTokenizer.from_pretrained("ucaslcl/GOT-OCR2_0", trust_remote_code=True)
|
|
|
13 |
import torch
|
14 |
import os
|
15 |
# Ensure Poppler is installed
|
16 |
+
poppler_path = "/usr/bin"
|
|
|
|
|
|
|
|
|
17 |
|
18 |
# Load the OCR model
|
19 |
tokenizer = AutoTokenizer.from_pretrained("ucaslcl/GOT-OCR2_0", trust_remote_code=True)
|