Update app.py
Browse files
app.py
CHANGED
|
@@ -32,7 +32,7 @@ def download_pdf_from_drive(file_id):
|
|
| 32 |
# Function to extract text from PDF
|
| 33 |
def extract_text_from_pdf(pdf_file):
|
| 34 |
with pdfplumber.open(pdf_file) as pdf:
|
| 35 |
-
return ' '.join(page.extract_text() for page in pdf.pages)
|
| 36 |
|
| 37 |
# Function to create embeddings and store them in FAISS
|
| 38 |
def create_embeddings(text):
|
|
|
|
| 32 |
# Function to extract text from PDF
|
| 33 |
def extract_text_from_pdf(pdf_file):
|
| 34 |
with pdfplumber.open(pdf_file) as pdf:
|
| 35 |
+
return ' '.join(page.extract_text() for page in pdf.pages if page.extract_text())
|
| 36 |
|
| 37 |
# Function to create embeddings and store them in FAISS
|
| 38 |
def create_embeddings(text):
|