Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -793,6 +793,10 @@ def compare_pronunciation(audio, lang_choice, intended_display_text, pass1_beam,
|
|
793 |
print(error_msg)
|
794 |
return (error_msg, "", "", "", "")
|
795 |
|
|
|
|
|
|
|
|
|
796 |
# ---------------- UI ---------------- #
|
797 |
with gr.Blocks(title="Pronunciation Comparator", theme=gr.themes.Soft()) as demo:
|
798 |
gr.Markdown("""
|
@@ -853,11 +857,7 @@ with gr.Blocks(title="Pronunciation Comparator", theme=gr.themes.Soft()) as demo
|
|
853 |
gr.Markdown("### π Enhanced Detailed Analysis")
|
854 |
feedback_display = gr.HTML()
|
855 |
|
856 |
-
|
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],
|
|
|
793 |
print(error_msg)
|
794 |
return (error_msg, "", "", "", "")
|
795 |
|
796 |
+
def get_sentence_for_display(language_choice):
|
797 |
+
sentence, transliteration = get_random_sentence_with_transliteration(language_choice)
|
798 |
+
return sentence
|
799 |
+
|
800 |
# ---------------- UI ---------------- #
|
801 |
with gr.Blocks(title="Pronunciation Comparator", theme=gr.themes.Soft()) as demo:
|
802 |
gr.Markdown("""
|
|
|
857 |
gr.Markdown("### π Enhanced Detailed Analysis")
|
858 |
feedback_display = gr.HTML()
|
859 |
|
860 |
+
# Event handlers
|
|
|
|
|
|
|
|
|
861 |
gen_btn.click(
|
862 |
fn=get_sentence_for_display,
|
863 |
inputs=[lang_choice],
|