Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,8 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
|
|
|
|
|
|
|
|
|
| 3 |
# μ μλμ΄ μ
λ ₯ν μ§λ¬Έμ μ μ₯νλ λ³μ
|
| 4 |
submitted_question = ""
|
| 5 |
|
|
@@ -21,13 +24,6 @@ def record_student_voice(voice):
|
|
| 21 |
else:
|
| 22 |
return "Please submit a question first."
|
| 23 |
|
| 24 |
-
# μ μ₯λ μμ± λͺ©λ‘ μ 곡
|
| 25 |
-
def get_recorded_list(question):
|
| 26 |
-
if question in recordings:
|
| 27 |
-
return recordings[question]
|
| 28 |
-
else:
|
| 29 |
-
return []
|
| 30 |
-
|
| 31 |
# Gradio μΈν°νμ΄μ€ μ μ
|
| 32 |
with gr.Blocks() as demo:
|
| 33 |
with gr.Tab("Teacher's Question"):
|
|
@@ -37,10 +33,9 @@ with gr.Blocks() as demo:
|
|
| 37 |
submit_question.click(teacher_question, inputs=question_input, outputs=[output_question])
|
| 38 |
|
| 39 |
with gr.Tab("Record Voice"):
|
| 40 |
-
voice_input = gr.Audio(type="numpy", label="Record your voice")
|
| 41 |
submit_voice = gr.Button("Submit Voice")
|
| 42 |
output_voice = gr.Textbox(label="Status")
|
| 43 |
-
submit_voice.click(record_student_voice,
|
| 44 |
|
| 45 |
def update_question_display(question):
|
| 46 |
output_voice.value = "Recording for question: " + question
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
# μ μ₯λ μμ± νμΌμ κ΄λ¦¬νλ λμ
λ리
|
| 4 |
+
recordings = {}
|
| 5 |
+
|
| 6 |
# μ μλμ΄ μ
λ ₯ν μ§λ¬Έμ μ μ₯νλ λ³μ
|
| 7 |
submitted_question = ""
|
| 8 |
|
|
|
|
| 24 |
else:
|
| 25 |
return "Please submit a question first."
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
# Gradio μΈν°νμ΄μ€ μ μ
|
| 28 |
with gr.Blocks() as demo:
|
| 29 |
with gr.Tab("Teacher's Question"):
|
|
|
|
| 33 |
submit_question.click(teacher_question, inputs=question_input, outputs=[output_question])
|
| 34 |
|
| 35 |
with gr.Tab("Record Voice"):
|
|
|
|
| 36 |
submit_voice = gr.Button("Submit Voice")
|
| 37 |
output_voice = gr.Textbox(label="Status")
|
| 38 |
+
submit_voice.click(record_student_voice, outputs=output_voice)
|
| 39 |
|
| 40 |
def update_question_display(question):
|
| 41 |
output_voice.value = "Recording for question: " + question
|