File size: 876 Bytes
c924c3e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import gradio as gr
from main import flow


with gr.Blocks(theme= "JohnSmith9982/small_and_pretty") as demo:
    with gr.Row():
        with gr.Column():
            student_pdf_path = gr.File(label="Student's PDF Response")
        with gr.Column():
            standard_pdf_path = gr.File(label="Standard Answer Key PDF")

    with gr.Row():
        submit_btn = gr.Button("Evaluate Exam")
        
    with gr.Row():
        output = gr.File(label="Output PDF Path")


    def evaluate_exam(student_pdf_path, standard_pdf_path):

        save_dict = True
        student_dict_path = "student_response.json"
        standard_dict_path = "standard_key.json"
        output_pdf_path = "output_report.pdf"

        return flow(student_pdf_path, standard_pdf_path, save_dict, student_dict_path, standard_dict_path, output_pdf_path)

demo.launch(share=True, pwa=True, debug=True)