SWivid commited on
Commit
75d1ceb
·
1 Parent(s): 29b5a47

fix auto-reset microphone

Browse files
Files changed (1) hide show
  1. src/f5_tts/infer/infer_gradio.py +7 -3
src/f5_tts/infer/infer_gradio.py CHANGED
@@ -567,7 +567,7 @@ Have a conversation with an AI using your reference voice!
567
 
568
  last_user_message, last_ai_response = history[-1]
569
  if not last_ai_response:
570
- return None, gr.update(interactive=True)
571
 
572
  audio_result, _ = infer(
573
  ref_audio,
@@ -579,7 +579,7 @@ Have a conversation with an AI using your reference voice!
579
  speed=1.0,
580
  show_info=print, # show_info=print no pull to top when generating
581
  )
582
- return audio_result, gr.update(interactive=True)
583
 
584
  def clear_conversation():
585
  """Reset the conversation"""
@@ -603,7 +603,11 @@ Have a conversation with an AI using your reference voice!
603
  ).then(
604
  generate_audio_response,
605
  inputs=[chatbot_interface, ref_audio_chat, ref_text_chat, model_choice_chat, remove_silence_chat],
606
- outputs=[audio_output_chat, audio_input_chat],
 
 
 
 
607
  )
608
 
609
  # Handle clear button
 
567
 
568
  last_user_message, last_ai_response = history[-1]
569
  if not last_ai_response:
570
+ return None
571
 
572
  audio_result, _ = infer(
573
  ref_audio,
 
579
  speed=1.0,
580
  show_info=print, # show_info=print no pull to top when generating
581
  )
582
+ return audio_result
583
 
584
  def clear_conversation():
585
  """Reset the conversation"""
 
603
  ).then(
604
  generate_audio_response,
605
  inputs=[chatbot_interface, ref_audio_chat, ref_text_chat, model_choice_chat, remove_silence_chat],
606
+ outputs=[audio_output_chat],
607
+ ).then(
608
+ lambda: None,
609
+ None,
610
+ audio_input_chat,
611
  )
612
 
613
  # Handle clear button