Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -170,6 +170,9 @@ def process_pdf(uploaded_files, llm_model, n_criteria = num_criteria):
|
|
170 |
output_files = []
|
171 |
for i, uploaded_file in enumerate(uploaded_files):
|
172 |
# Process the PDF file
|
|
|
|
|
|
|
173 |
pdf_processor = PDFProcessor_Unstructured(pdf_processing_config)
|
174 |
merged_chunks, tables, title = pdf_processor.process_pdf_file(uploaded_file)
|
175 |
documents = [Document(text=t) for t in merged_chunks]
|
@@ -251,8 +254,7 @@ def process_pdf(uploaded_files, llm_model, n_criteria = num_criteria):
|
|
251 |
# Generate the score bar HTML
|
252 |
score_bar_html = generate_score_bar(total_score, n_criteria)
|
253 |
scaled_total_score = str(round((total_score / n_criteria) * 100)) + "/100"
|
254 |
-
|
255 |
-
create_pdf_report(title, author_result, scaled_total_score, reasoning_text, output_path)
|
256 |
output_files.append(output_path)
|
257 |
|
258 |
# Construct the processing message
|
|
|
170 |
output_files = []
|
171 |
for i, uploaded_file in enumerate(uploaded_files):
|
172 |
# Process the PDF file
|
173 |
+
file_name_without_extension = os.path.splitext(os.path.basename(uploaded_file))[0]
|
174 |
+
file_name_without_extension
|
175 |
+
|
176 |
pdf_processor = PDFProcessor_Unstructured(pdf_processing_config)
|
177 |
merged_chunks, tables, title = pdf_processor.process_pdf_file(uploaded_file)
|
178 |
documents = [Document(text=t) for t in merged_chunks]
|
|
|
254 |
# Generate the score bar HTML
|
255 |
score_bar_html = generate_score_bar(total_score, n_criteria)
|
256 |
scaled_total_score = str(round((total_score / n_criteria) * 100)) + "/100"
|
257 |
+
create_pdf_report(title, author_result, scaled_total_score, reasoning_text, file_name_without_extension)
|
|
|
258 |
output_files.append(output_path)
|
259 |
|
260 |
# Construct the processing message
|