Spaces:
Runtime error
Runtime error
jinggujiwoo7
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -47,33 +47,33 @@ with gr.Blocks() as demo:
|
|
47 |
question_input = gr.Textbox(lines=2, placeholder="Enter your question here...", label="Teacher's Question")
|
48 |
submit_question = gr.Button("Submit")
|
49 |
output_question = gr.Textbox(label="Submitted Question")
|
50 |
-
submit_question.click(
|
51 |
|
52 |
with gr.Tab("Record Voice"):
|
53 |
student_name_input = gr.Textbox(placeholder="Your name", label="Your name")
|
54 |
question_display = gr.Textbox(label="Question", interactive=False)
|
55 |
-
voice_input = gr.Audio(type="
|
56 |
submit_voice = gr.Button("Submit Voice")
|
57 |
output_voice = gr.Textbox(label="Status")
|
58 |
-
submit_voice.click(
|
59 |
demo.load(lambda question: gr.update(value=question), inputs=state_question, outputs=question_display)
|
60 |
|
61 |
with gr.Tab("List Voices"):
|
62 |
question_list_input = gr.Textbox(placeholder="Question", label="Enter question to list recordings")
|
63 |
submit_list = gr.Button("Get Recordings")
|
64 |
recordings_list = gr.Dropdown(label="Select a recording to play")
|
65 |
-
submit_list.click(
|
66 |
|
67 |
with gr.Tab("Play Voice"):
|
68 |
recording_select = gr.Dropdown(label="Select a recording to play")
|
69 |
-
play_audio = gr.Audio(type="
|
70 |
-
recording_select.change(
|
71 |
|
72 |
with gr.Tab("Write Comment"):
|
73 |
comment_question_input = gr.Textbox(placeholder="Question", label="Question")
|
74 |
comment_input = gr.Textbox(placeholder="Your comment", label="Comment")
|
75 |
submit_comment = gr.Button("Submit Comment")
|
76 |
output_comment = gr.Textbox(label="Status")
|
77 |
-
submit_comment.click(
|
78 |
|
79 |
demo.launch()
|
|
|
47 |
question_input = gr.Textbox(lines=2, placeholder="Enter your question here...", label="Teacher's Question")
|
48 |
submit_question = gr.Button("Submit")
|
49 |
output_question = gr.Textbox(label="Submitted Question")
|
50 |
+
submit_question.click(teacher_question, inputs=question_input, outputs=[output_question, state_question])
|
51 |
|
52 |
with gr.Tab("Record Voice"):
|
53 |
student_name_input = gr.Textbox(placeholder="Your name", label="Your name")
|
54 |
question_display = gr.Textbox(label="Question", interactive=False)
|
55 |
+
voice_input = gr.Audio(type="file", label="Record your voice")
|
56 |
submit_voice = gr.Button("Submit Voice")
|
57 |
output_voice = gr.Textbox(label="Status")
|
58 |
+
submit_voice.click(record_student_voice, inputs=[student_name_input, state_question, voice_input], outputs=output_voice)
|
59 |
demo.load(lambda question: gr.update(value=question), inputs=state_question, outputs=question_display)
|
60 |
|
61 |
with gr.Tab("List Voices"):
|
62 |
question_list_input = gr.Textbox(placeholder="Question", label="Enter question to list recordings")
|
63 |
submit_list = gr.Button("Get Recordings")
|
64 |
recordings_list = gr.Dropdown(label="Select a recording to play")
|
65 |
+
submit_list.click(get_recorded_list, inputs=question_list_input, outputs=recordings_list)
|
66 |
|
67 |
with gr.Tab("Play Voice"):
|
68 |
recording_select = gr.Dropdown(label="Select a recording to play")
|
69 |
+
play_audio = gr.Audio(type="file", label="Recorded Voice")
|
70 |
+
recording_select.change(lambda x: x, inputs=recording_select, outputs=play_audio)
|
71 |
|
72 |
with gr.Tab("Write Comment"):
|
73 |
comment_question_input = gr.Textbox(placeholder="Question", label="Question")
|
74 |
comment_input = gr.Textbox(placeholder="Your comment", label="Comment")
|
75 |
submit_comment = gr.Button("Submit Comment")
|
76 |
output_comment = gr.Textbox(label="Status")
|
77 |
+
submit_comment.click(write_comment, inputs=[comment_question_input, comment_input], outputs=output_comment)
|
78 |
|
79 |
demo.launch()
|