kpal002 commited on
Commit
940e0f3
1 Parent(s): d2d45e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -170,8 +170,12 @@ def process_pdf(uploaded_files, llm_model, n_criteria = num_criteria):
170
  # Process the PDF file
171
  file_name_without_extension = os.path.splitext(os.path.basename(uploaded_file))[0]
172
 
173
- id_number = re.search(r"Id_(\d+)\.", file_name_without_extension)
174
- print(id_number)
 
 
 
 
175
 
176
  pdf_processor = PDFProcessor_Unstructured(pdf_processing_config)
177
  merged_chunks, tables, title = pdf_processor.process_pdf_file(uploaded_file)
 
170
  # Process the PDF file
171
  file_name_without_extension = os.path.splitext(os.path.basename(uploaded_file))[0]
172
 
173
+ id_search = re.search(r"Id_(\d+)\.", file_name_without_extension)
174
+ if id_search:
175
+ id_number = id_search.group(1)
176
+ else:
177
+ print(f"ID not found in file name: {uploaded_file}")
178
+ continue
179
 
180
  pdf_processor = PDFProcessor_Unstructured(pdf_processing_config)
181
  merged_chunks, tables, title = pdf_processor.process_pdf_file(uploaded_file)