Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,14 @@
|
|
1 |
import streamlit as st
|
2 |
-
import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
from transformers import pipeline
|
4 |
|
5 |
# Function to extract text from PDFs using pdfplumber
|
|
|
1 |
import streamlit as st
|
2 |
+
import subprocess
|
3 |
+
import sys
|
4 |
+
|
5 |
+
# Install pdfplumber if it's not already installed
|
6 |
+
try:
|
7 |
+
import pdfplumber
|
8 |
+
except ModuleNotFoundError:
|
9 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "pdfplumber"])
|
10 |
+
import pdfplumber # Re-import after installation
|
11 |
+
|
12 |
from transformers import pipeline
|
13 |
|
14 |
# Function to extract text from PDFs using pdfplumber
|