Spaces:
Sleeping
Sleeping
# Event handlers for buttons | |
gen_btn.click( | |
fn=get_random_sentence, | |
inputs=[lang_choice], | |
outputs=[intended_display] | |
) | |
analyze_btn.click( | |
fn=compare_pronunciation, | |
inputs=[audio_input, lang_choice, intended_display], | |
outputs=[ | |
status_output, # status | |
pass1_out, # actual_text | |
pass2_out, # corrected_text | |
wer_out, # wer formatted | |
cer_out, # cer formatted | |
gr.skip(), # actual_text (duplicate) | |
gr.skip(), # actual_hk (not displayed) | |
gr.skip(), # intended_sentence (duplicate) | |
gr.skip(), # target_hk (not displayed) | |
diff_html_box, # diff_html | |
char_html_box, # char_html | |
gr.skip(), # intended_sentence (duplicate) | |
target_display # target_display | |
] | |
) | |
# Auto-generate sentence on language change | |
lang_choice.change( | |
fn=get_random_sentence, | |
inputs=[lang_choice], | |
outputs=[intended_display] | |
) |