Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -156,11 +156,13 @@ def clear_index():
|
|
| 156 |
return f"Error clearing Pinecone index: {str(e)}"
|
| 157 |
|
| 158 |
def upload_pdf(file):
|
|
|
|
| 159 |
if file is None:
|
| 160 |
return "Please upload a PDF file."
|
| 161 |
|
| 162 |
file_path = file.name
|
| 163 |
result = process_pdf(file_path)
|
|
|
|
| 164 |
return result
|
| 165 |
|
| 166 |
|
|
|
|
| 156 |
return f"Error clearing Pinecone index: {str(e)}"
|
| 157 |
|
| 158 |
def upload_pdf(file):
|
| 159 |
+
global pdf_processed
|
| 160 |
if file is None:
|
| 161 |
return "Please upload a PDF file."
|
| 162 |
|
| 163 |
file_path = file.name
|
| 164 |
result = process_pdf(file_path)
|
| 165 |
+
pdf_processed = True
|
| 166 |
return result
|
| 167 |
|
| 168 |
|