Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -576,4 +576,26 @@ with gr.Blocks(title="LeadIB AI Grading (Final Flow — Verbose)") as demo:
|
|
| 576 |
qpms_box = gr.Textbox(label="📑 QP+MS Transcript", lines=12)
|
| 577 |
as_box = gr.Textbox(label="📝 AS Transcript", lines=12)
|
| 578 |
|
| 579 |
-
grading_output_box = gr.Textbox(label="🧾 Grading (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 576 |
qpms_box = gr.Textbox(label="📑 QP+MS Transcript", lines=12)
|
| 577 |
as_box = gr.Textbox(label="📝 AS Transcript", lines=12)
|
| 578 |
|
| 579 |
+
grading_output_box = gr.Textbox(label="🧾 Grading (Markdown)", lines=20)
|
| 580 |
+
grading_pdf_file = gr.File(label="📥 Download Grading PDF")
|
| 581 |
+
imprint_pdf_file = gr.File(label="📥 Download Imprinted PDF (Optional)")
|
| 582 |
+
|
| 583 |
+
def run_pipeline(qp_file_obj, ms_file_obj, ans_file_obj, imprint_flag):
|
| 584 |
+
qp_path = qp_file_obj.name
|
| 585 |
+
ms_path = ms_file_obj.name
|
| 586 |
+
ans_path = ans_file_obj.name
|
| 587 |
+
|
| 588 |
+
qpms_text, as_text, grading_text, grading_pdf_path, imprinted_pdf_path = align_and_grade_pipeline(
|
| 589 |
+
qp_path, ms_path, ans_path, imprint=imprint_flag
|
| 590 |
+
)
|
| 591 |
+
|
| 592 |
+
return qpms_text or "", as_text or "", grading_text or "", grading_pdf_path, imprinted_pdf_path
|
| 593 |
+
|
| 594 |
+
run_button.click(
|
| 595 |
+
fn=run_pipeline,
|
| 596 |
+
inputs=[qp_file, ms_file, ans_file, imprint_toggle],
|
| 597 |
+
outputs=[qpms_box, as_box, grading_output_box, grading_pdf_file, imprint_pdf_file]
|
| 598 |
+
)
|
| 599 |
+
|
| 600 |
+
if __name__ == "__main__":
|
| 601 |
+
demo.launch()
|