Update spoken_module.py
Browse files- spoken_module.py +13 -5
spoken_module.py
CHANGED
|
@@ -58,7 +58,7 @@ Transcript:
|
|
| 58 |
)
|
| 59 |
return response.choices[0].message.content
|
| 60 |
|
| 61 |
-
def spoken_dashboard(
|
| 62 |
with gr.Column() as spoken_panel:
|
| 63 |
gr.Markdown("""
|
| 64 |
<div id="header" style="text-align: center;">
|
|
@@ -94,7 +94,7 @@ def spoken_dashboard(nickname):
|
|
| 94 |
trend_plot = gr.Plot(label="📈 Tone Trend")
|
| 95 |
milestone_box = gr.Markdown(visible=False)
|
| 96 |
|
| 97 |
-
def tutor_feedback(audio_file, language, goal, focus_areas):
|
| 98 |
if not audio_file:
|
| 99 |
return "", "No audio received.", None, "", [], None, None, gr.update(visible=False)
|
| 100 |
|
|
@@ -132,11 +132,19 @@ def spoken_dashboard(nickname):
|
|
| 132 |
|
| 133 |
audio_input.change(
|
| 134 |
fn=tutor_feedback,
|
| 135 |
-
inputs=[
|
| 136 |
-
|
| 137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
)
|
| 139 |
|
|
|
|
| 140 |
try_again.click(fn=lambda: ("", "", None, "", "", None, None, gr.update(visible=False)),
|
| 141 |
inputs=None,
|
| 142 |
outputs=[transcript_box, feedback_box, audio_output, hidden_transcript, example_box, comparison_plot, trend_plot, milestone_box])
|
|
|
|
| 58 |
)
|
| 59 |
return response.choices[0].message.content
|
| 60 |
|
| 61 |
+
def spoken_dashboard(nickname_input):
|
| 62 |
with gr.Column() as spoken_panel:
|
| 63 |
gr.Markdown("""
|
| 64 |
<div id="header" style="text-align: center;">
|
|
|
|
| 94 |
trend_plot = gr.Plot(label="📈 Tone Trend")
|
| 95 |
milestone_box = gr.Markdown(visible=False)
|
| 96 |
|
| 97 |
+
def tutor_feedback(audio_file, language, goal, focus_areas, nickname):
|
| 98 |
if not audio_file:
|
| 99 |
return "", "No audio received.", None, "", [], None, None, gr.update(visible=False)
|
| 100 |
|
|
|
|
| 132 |
|
| 133 |
audio_input.change(
|
| 134 |
fn=tutor_feedback,
|
| 135 |
+
inputs=[
|
| 136 |
+
audio_input, language_dropdown,
|
| 137 |
+
goal_dropdown, focus_checkboxes,
|
| 138 |
+
nickname_input # ✅ This is the actual textbox, not a State object
|
| 139 |
+
],
|
| 140 |
+
outputs=[
|
| 141 |
+
transcript_box, feedback_box, audio_output,
|
| 142 |
+
hidden_transcript, history_table,
|
| 143 |
+
score_chart, trend_chart, milestone_box
|
| 144 |
+
]
|
| 145 |
)
|
| 146 |
|
| 147 |
+
|
| 148 |
try_again.click(fn=lambda: ("", "", None, "", "", None, None, gr.update(visible=False)),
|
| 149 |
inputs=None,
|
| 150 |
outputs=[transcript_box, feedback_box, audio_output, hidden_transcript, example_box, comparison_plot, trend_plot, milestone_box])
|