John Langley commited on
Commit
1a4332d
·
1 Parent(s): 822e761

streaming voice

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -85,21 +85,22 @@ async def create_demo():
85
  with gr.Row():
86
 
87
  with gr.Column(scale=1, min_width=300):
 
88
  user_msg = gr.Textbox(placeholder="Enter text here or speak into your microphone")
89
  audio_record = gr.Audio(sources=["microphone"], type="filepath", scale=4)
90
- ai_response = gr.Label(show_label=True,label="LLM Sentence currently being processed")
91
  submit_button = gr.Button("Submit")
92
- speech_button = gr.Button("Test Speech")
93
  audio_playback = gr.Audio(
94
  value=None,
95
  label="Generated audio response",
96
  streaming=True,
97
  autoplay=True,interactive=False,
98
  show_label=True,
 
99
  )
100
 
101
  with gr.Column(scale=1, min_width=300):
102
- voice = gr.Dropdown(choices=[""] + list(voices.keys()), label="Select Voice", value="")
103
  # Define chatbot component
104
  chatbot = gr.Chatbot(
105
  value=[(None, "Hi, I'm an AI training assistant. Let's get going, how should we start?")], # Initial greeting from the chatbot
 
85
  with gr.Row():
86
 
87
  with gr.Column(scale=1, min_width=300):
88
+ voice = gr.Dropdown(choices=[""] + list(voices.keys()), label="Select Voice", value="")
89
  user_msg = gr.Textbox(placeholder="Enter text here or speak into your microphone")
90
  audio_record = gr.Audio(sources=["microphone"], type="filepath", scale=4)
 
91
  submit_button = gr.Button("Submit")
92
+ speech_button = gr.Button("Test Speech", visible=False)
93
  audio_playback = gr.Audio(
94
  value=None,
95
  label="Generated audio response",
96
  streaming=True,
97
  autoplay=True,interactive=False,
98
  show_label=True,
99
+ visible=False
100
  )
101
 
102
  with gr.Column(scale=1, min_width=300):
103
+ ai_response = gr.Label(show_label=True,label="LLM Sentence currently being processed")
104
  # Define chatbot component
105
  chatbot = gr.Chatbot(
106
  value=[(None, "Hi, I'm an AI training assistant. Let's get going, how should we start?")], # Initial greeting from the chatbot