Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -298,7 +298,12 @@ def bot(history, choice, tts_choice):
|
|
298 |
audio_path = audio_future.result()
|
299 |
yield history, audio_path
|
300 |
|
|
|
|
|
|
|
|
|
301 |
def add_message(history, message):
|
|
|
302 |
history.append((message, None))
|
303 |
return history, gr.Textbox(value="", interactive=True, placeholder="Enter message or upload file...", show_label=False)
|
304 |
|
@@ -646,7 +651,7 @@ with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
|
646 |
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input],api_name="voice_query")
|
647 |
tts_choice = gr.Radio(label="Select TTS System", choices=["Eleven Labs", "Parler-TTS", "MARS5"], value="Eleven Labs")
|
648 |
retriver_button = gr.Button("Retriver")
|
649 |
-
retriver_button.click(fn=add_message, inputs=[
|
650 |
fn=bot, inputs=[chatbot, choice, tts_choice], outputs=[chatbot, gr.Audio(interactive=False, autoplay=True)]
|
651 |
)
|
652 |
|
|
|
298 |
audio_path = audio_future.result()
|
299 |
yield history, audio_path
|
300 |
|
301 |
+
# def add_message(history, message):
|
302 |
+
# history.append((message, None))
|
303 |
+
# return history, gr.Textbox(value="", interactive=True, placeholder="Enter message or upload file...", show_label=False)
|
304 |
+
|
305 |
def add_message(history, message):
|
306 |
+
history = history or []
|
307 |
history.append((message, None))
|
308 |
return history, gr.Textbox(value="", interactive=True, placeholder="Enter message or upload file...", show_label=False)
|
309 |
|
|
|
651 |
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input],api_name="voice_query")
|
652 |
tts_choice = gr.Radio(label="Select TTS System", choices=["Eleven Labs", "Parler-TTS", "MARS5"], value="Eleven Labs")
|
653 |
retriver_button = gr.Button("Retriver")
|
654 |
+
retriver_button.click(fn=add_message, inputs=[chatbot, chat_input], outputs=[chatbot, chat_input]).then(
|
655 |
fn=bot, inputs=[chatbot, choice, tts_choice], outputs=[chatbot, gr.Audio(interactive=False, autoplay=True)]
|
656 |
)
|
657 |
|