vishwask commited on
Commit
2b40ee8
·
verified ·
1 Parent(s): f931503

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -240,9 +240,12 @@ def demo():
240
  collection_name = gr.State()
241
  pdf_directory = '/home/user/app/pdfs'
242
 
243
- # List all PDF files in the directory
244
- pdf_files = [os.path.join(pdf_directory, file) for file in os.listdir(pdf_directory) if file.endswith(".pdf")]
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