Shanulhaq commited on
Commit
2e67cbf
1 Parent(s): 4ab0367

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -1,5 +1,14 @@
1
  import streamlit as st
2
- import pdfplumber # Ensure this is installed correctly
 
 
 
 
 
 
 
 
 
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