From 7a0ef1c9414610e5744b302b82c6a6b3e877cb3b Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 13 Apr 2023 10:40:27 -0300 Subject: [PATCH] Reorganize whisper extension --- extensions/whisper_stt/script.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/whisper_stt/script.py b/extensions/whisper_stt/script.py index 36169535..9daee7be 100644 --- a/extensions/whisper_stt/script.py +++ b/extensions/whisper_stt/script.py @@ -40,5 +40,7 @@ def ui(): with gr.Row(): audio = gr.Audio(source="microphone") auto_submit = gr.Checkbox(label='Submit the transcribed audio automatically', value=True) - audio.change(fn=auto_transcribe, inputs=[audio, auto_submit], outputs=[shared.gradio['textbox'], audio]) - audio.change(None, auto_submit, None, _js="(check) => {if (check) { document.getElementById('Generate').click() }}") + + audio.change( + auto_transcribe, [audio, auto_submit], [shared.gradio['textbox'], audio]).then( + None, auto_submit, None, _js="(check) => {if (check) { document.getElementById('Generate').click() }}")