Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -209,19 +209,15 @@ def process_pdf(uploaded_files, llm_model, n_criteria = num_criteria):
|
|
209 |
# Evaluate with OpenAI model
|
210 |
total_score, criteria_met, score_percentage, reasoning = pdf_criteria_query.evaluate_with_llm(registration_result, peer_journal_result, eq_journal_result, queries)
|
211 |
|
212 |
-
|
213 |
-
for
|
214 |
-
|
215 |
-
reasoning_html += "</ul>"
|
216 |
|
217 |
# Generate the score bar HTML
|
218 |
score_bar_html = generate_score_bar(total_score, n_criteria)
|
219 |
-
|
220 |
-
author_info_html = f"<div style='font-size: 18px;'>{author_result}</div>"
|
221 |
-
title_info_html = f"<div style='font-size: 20px;'>{title}</div>"
|
222 |
|
223 |
output_path = f"/tmp/paper_report_{i+1}.pdf"
|
224 |
-
create_pdf_report(
|
225 |
output_files.append(output_path)
|
226 |
|
227 |
# Construct the processing message
|
|
|
209 |
# Evaluate with OpenAI model
|
210 |
total_score, criteria_met, score_percentage, reasoning = pdf_criteria_query.evaluate_with_llm(registration_result, peer_journal_result, eq_journal_result, queries)
|
211 |
|
212 |
+
# Convert reasoning list to plain text
|
213 |
+
reasoning_text = "\n".join([f"{idx + 1}. {reason}" for idx, reason in enumerate(reasoning)])
|
214 |
+
|
|
|
215 |
|
216 |
# Generate the score bar HTML
|
217 |
score_bar_html = generate_score_bar(total_score, n_criteria)
|
|
|
|
|
|
|
218 |
|
219 |
output_path = f"/tmp/paper_report_{i+1}.pdf"
|
220 |
+
create_pdf_report(title, author_result, total_score, reasoning_html, output_path)
|
221 |
output_files.append(output_path)
|
222 |
|
223 |
# Construct the processing message
|