Update app.py
Browse files
app.py
CHANGED
|
@@ -239,7 +239,7 @@ def generate_pdf(score, checklist_summary, missing_summary, status):
|
|
| 239 |
raise FileNotFoundError(f"PDF file {pdf_path} was not created")
|
| 240 |
|
| 241 |
logging.info(f"PDF generated successfully at {pdf_path}")
|
| 242 |
-
return pdf_path # Return the file path
|
| 243 |
except Exception as e:
|
| 244 |
logging.error(f"Error in generate_pdf: {str(e)}")
|
| 245 |
raise
|
|
@@ -283,8 +283,7 @@ with gr.Blocks(css="""progress { background-color: #f0f0f0; } .red { background-
|
|
| 283 |
pdf_btn.click(
|
| 284 |
fn=generate_pdf,
|
| 285 |
inputs=[score_output, checklist_output, missing_output, status_output],
|
| 286 |
-
outputs=[pdf_output, pdf_debug]
|
| 287 |
-
_js="() => { return ['Generating PDF...'] }" # Debug message to confirm button click
|
| 288 |
)
|
| 289 |
|
| 290 |
# Launch the app (commented out for Hugging Face deployment)
|
|
|
|
| 239 |
raise FileNotFoundError(f"PDF file {pdf_path} was not created")
|
| 240 |
|
| 241 |
logging.info(f"PDF generated successfully at {pdf_path}")
|
| 242 |
+
return pdf_path, "PDF generation triggered successfully" # Return the file path and debug message
|
| 243 |
except Exception as e:
|
| 244 |
logging.error(f"Error in generate_pdf: {str(e)}")
|
| 245 |
raise
|
|
|
|
| 283 |
pdf_btn.click(
|
| 284 |
fn=generate_pdf,
|
| 285 |
inputs=[score_output, checklist_output, missing_output, status_output],
|
| 286 |
+
outputs=[pdf_output, pdf_debug]
|
|
|
|
| 287 |
)
|
| 288 |
|
| 289 |
# Launch the app (commented out for Hugging Face deployment)
|