Skip to content

Commit

Permalink
Added Clear Button
Browse files Browse the repository at this point in the history
  • Loading branch information
w11wo committed Jun 30, 2023
1 parent b726349 commit aa5185b
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions spaces/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def recognize_audio_from_mic(
transcript = streaming_recognizer.text
if transcript:
state = transcript
print(transcript)
return state, state


Expand Down Expand Up @@ -185,13 +184,17 @@ def update_model_dropdown(language: str):
outputs=[mic_text_output, state],
show_progress=False,
)
# with gr.Row():
# file_clear_button = gr.ClearButton(
# components=[mic_text_output, state]
# ).click(
# initialize_streaming_recognizer,
# inputs=[model_dropdown, decoding_method_radio],
# )
with gr.Row():
file_clear_button = gr.ClearButton(
components=[mic_text_output, state]
).click(
get_pretrained_model,
inputs=[
model_dropdown.value,
decoding_method_radio.value,
num_active_paths_slider.value,
],
)

upload_button.click(
process_uploaded_file,
Expand Down

0 comments on commit aa5185b

Please sign in to comment.