Pijush2023 commited on
Commit
934e44a
·
verified ·
1 Parent(s): ffb1ecc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -291,6 +291,10 @@ def transcribe_function(stream, new_chunk):
291
  return stream, full_text, full_text
292
 
293
 
 
 
 
 
294
 
295
 
296
  # Create the Gradio Blocks interface
@@ -309,6 +313,8 @@ with gr.Blocks(theme="rawrsor1/Everforest") as demo:
309
  with gr.Row():
310
  with gr.Column():
311
  get_response_btn = gr.Button("Get Response")
 
 
312
  with gr.Column():
313
  generate_audio_btn = gr.Button("Generate Audio")
314
  with gr.Column():
@@ -335,6 +341,11 @@ with gr.Blocks(theme="rawrsor1/Everforest") as demo:
335
  generate_audio_btn.click(fn=generate_audio_from_last_response, inputs=chatbot, outputs=audio_output)
336
  clean_btn.click(fn=clear_fields, inputs=[], outputs=[chatbot, question_input, audio_output])
337
 
 
 
 
 
 
338
  # Launch the Gradio interface
339
  demo.launch(show_error=True)
340
 
 
291
  return stream, full_text, full_text
292
 
293
 
294
+ # Define the function to clear the state and input text
295
+ def clear_transcription_state():
296
+ return None, ""
297
+
298
 
299
 
300
  # Create the Gradio Blocks interface
 
313
  with gr.Row():
314
  with gr.Column():
315
  get_response_btn = gr.Button("Get Response")
316
+ with gr.Column():
317
+ clear_state_btn = gr.Button("Clear State")
318
  with gr.Column():
319
  generate_audio_btn = gr.Button("Generate Audio")
320
  with gr.Column():
 
341
  generate_audio_btn.click(fn=generate_audio_from_last_response, inputs=chatbot, outputs=audio_output)
342
  clean_btn.click(fn=clear_fields, inputs=[], outputs=[chatbot, question_input, audio_output])
343
 
344
+
345
+ # Clear state interaction
346
+ clear_state_btn.click(fn=clear_transcription_state, outputs=[question_input, state])
347
+
348
+
349
  # Launch the Gradio interface
350
  demo.launch(show_error=True)
351