Update app.py
Browse files
app.py
CHANGED
@@ -240,9 +240,12 @@ def demo():
|
|
240 |
collection_name = gr.State()
|
241 |
pdf_directory = '/home/user/app/pdfs'
|
242 |
|
243 |
-
|
244 |
-
|
245 |
-
|
|
|
|
|
|
|
246 |
# Create a dictionary with the necessary information
|
247 |
pdf_dict = {"value": process_pdfs, "height": 100, "file_count": "multiple", "visible": True, "file_types": ["pdf"], "interactive": True, "label": "Uploaded PDF documents"}
|
248 |
|
|
|
240 |
collection_name = gr.State()
|
241 |
pdf_directory = '/home/user/app/pdfs'
|
242 |
|
243 |
+
|
244 |
+
def process_pdfs():
|
245 |
+
# List all PDF files in the directory
|
246 |
+
pdf_files = [os.path.join(pdf_directory, file) for file in os.listdir(pdf_directory) if file.endswith(".pdf")]
|
247 |
+
return pdf_files
|
248 |
+
|
249 |
# Create a dictionary with the necessary information
|
250 |
pdf_dict = {"value": process_pdfs, "height": 100, "file_count": "multiple", "visible": True, "file_types": ["pdf"], "interactive": True, "label": "Uploaded PDF documents"}
|
251 |
|