Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -857,18 +857,18 @@ def get_sentence_for_display(language_choice):
|
|
857 |
sentence, transliteration = get_random_sentence_with_transliteration(language_choice)
|
858 |
return sentence
|
859 |
|
860 |
-
# Event handlers
|
861 |
-
gen_btn.click(
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
)
|
866 |
-
|
867 |
-
analyze_btn.click(
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
)
|
872 |
|
873 |
if __name__ == "__main__":
|
874 |
demo.launch()
|
|
|
857 |
sentence, transliteration = get_random_sentence_with_transliteration(language_choice)
|
858 |
return sentence
|
859 |
|
860 |
+
# Event handlers - MUST be inside the gr.Blocks context
|
861 |
+
gen_btn.click(
|
862 |
+
fn=get_sentence_for_display,
|
863 |
+
inputs=[lang_choice],
|
864 |
+
outputs=[intended_display]
|
865 |
+
)
|
866 |
+
|
867 |
+
analyze_btn.click(
|
868 |
+
fn=compare_pronunciation,
|
869 |
+
inputs=[audio_input, lang_choice, intended_display, pass1_beam, pass1_temp],
|
870 |
+
outputs=[pass1_out, actual_roman_out, wer_out, cer_out, feedback_display]
|
871 |
+
)
|
872 |
|
873 |
if __name__ == "__main__":
|
874 |
demo.launch()
|