Vadym Myroshnyk commited on
Commit ·
e36359e
1
Parent(s): d17d083
save
Browse files- service/oral/oral_service.py +10 -1
service/oral/oral_service.py
CHANGED
|
@@ -131,7 +131,16 @@ def oral_exercise(audio_dir: str, expected_result_dir: str, instruction: str):
|
|
| 131 |
|
| 132 |
if audio_inputs and textboxes:
|
| 133 |
gr.Button("🧠 Transcribe").click(fn=on_transcribe, inputs=audio_inputs[0], outputs=textboxes[0])
|
| 134 |
-
gr.Button("🔁 Record again").click(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
gr.Button("✅ Check").click(
|
| 136 |
fn=on_check,
|
| 137 |
inputs=textboxes,
|
|
|
|
| 131 |
|
| 132 |
if audio_inputs and textboxes:
|
| 133 |
gr.Button("🧠 Transcribe").click(fn=on_transcribe, inputs=audio_inputs[0], outputs=textboxes[0])
|
| 134 |
+
gr.Button("🔁 Record again").click(
|
| 135 |
+
fn=lambda: (
|
| 136 |
+
gr.update(value=None),
|
| 137 |
+
*[gr.update(visible=False) for _ in accordion_outputs],
|
| 138 |
+
*[gr.update(value="") for _ in diff_html],
|
| 139 |
+
*[gr.update(value="") for _ in feedback_html],
|
| 140 |
+
),
|
| 141 |
+
inputs=[],
|
| 142 |
+
outputs=[audio_inputs[0]] + accordion_outputs + diff_html + feedback_html
|
| 143 |
+
)
|
| 144 |
gr.Button("✅ Check").click(
|
| 145 |
fn=on_check,
|
| 146 |
inputs=textboxes,
|