Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1606,6 +1606,15 @@ with gr.Blocks(theme='gradio/soft') as demo:
|
|
1606 |
.then(fn=clear_textbox, inputs=[], outputs=[chat_input], api_name="api_clear_textbox")
|
1607 |
)
|
1608 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1609 |
|
1610 |
|
1611 |
|
@@ -1613,14 +1622,23 @@ with gr.Blocks(theme='gradio/soft') as demo:
|
|
1613 |
|
1614 |
|
1615 |
|
1616 |
-
chat_input.submit(fn=stop_audio, inputs=[], outputs=[audio_output], api_name="api_stop_audio_recording").then(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1617 |
fn=add_message, inputs=[chatbot, chat_input], outputs=[chatbot, chat_input], api_name="api_addprompt_chathistory"
|
1618 |
).then(
|
1619 |
# First, generate the bot response
|
1620 |
fn=generate_bot_response, inputs=[chatbot, choice, retrieval_mode, model_choice], outputs=[chatbot], api_name="api_generate_bot_response"
|
1621 |
-
).then(
|
1622 |
-
# Then, generate the TTS response based on the bot's response
|
1623 |
-
fn=generate_tts_response, inputs=[chatbot, tts_choice], outputs=[audio_output], api_name="api_generate_tts_response"
|
1624 |
).then(
|
1625 |
fn=clear_textbox, inputs=[], outputs=[chat_input], api_name="api_clear_textbox"
|
1626 |
)
|
@@ -1631,6 +1649,7 @@ with gr.Blocks(theme='gradio/soft') as demo:
|
|
1631 |
|
1632 |
|
1633 |
|
|
|
1634 |
audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy', every=0.1)
|
1635 |
audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="api_voice_to_text")
|
1636 |
|
|
|
1606 |
.then(fn=clear_textbox, inputs=[], outputs=[chat_input], api_name="api_clear_textbox")
|
1607 |
)
|
1608 |
|
1609 |
+
retriever_sequence = (
|
1610 |
+
retriever_button.click(fn=stop_audio, inputs=[], outputs=[audio_output], api_name="api_stop_audio_recording")
|
1611 |
+
.then(fn=add_message, inputs=[chatbot, chat_input], outputs=[chatbot, chat_input], api_name="api_addprompt_chathistory")
|
1612 |
+
# First, generate the bot response
|
1613 |
+
.then(fn=generate_bot_response, inputs=[chatbot, choice, retrieval_mode, model_choice], outputs=[chatbot], api_name="api_generate_bot_response")
|
1614 |
+
.then(fn=clear_textbox, inputs=[], outputs=[chat_input], api_name="api_clear_textbox")
|
1615 |
+
)
|
1616 |
+
|
1617 |
+
|
1618 |
|
1619 |
|
1620 |
|
|
|
1622 |
|
1623 |
|
1624 |
|
1625 |
+
# chat_input.submit(fn=stop_audio, inputs=[], outputs=[audio_output], api_name="api_stop_audio_recording").then(
|
1626 |
+
# fn=add_message, inputs=[chatbot, chat_input], outputs=[chatbot, chat_input], api_name="api_addprompt_chathistory"
|
1627 |
+
# ).then(
|
1628 |
+
# # First, generate the bot response
|
1629 |
+
# fn=generate_bot_response, inputs=[chatbot, choice, retrieval_mode, model_choice], outputs=[chatbot], api_name="api_generate_bot_response"
|
1630 |
+
# ).then(
|
1631 |
+
# # Then, generate the TTS response based on the bot's response
|
1632 |
+
# fn=generate_tts_response, inputs=[chatbot, tts_choice], outputs=[audio_output], api_name="api_generate_tts_response"
|
1633 |
+
# ).then(
|
1634 |
+
# fn=clear_textbox, inputs=[], outputs=[chat_input], api_name="api_clear_textbox"
|
1635 |
+
# )
|
1636 |
+
|
1637 |
+
chat_input.submit(fn=stop_audio, inputs=[], outputs=[audio_output], api_name="api_stop_audio_recording").then(
|
1638 |
fn=add_message, inputs=[chatbot, chat_input], outputs=[chatbot, chat_input], api_name="api_addprompt_chathistory"
|
1639 |
).then(
|
1640 |
# First, generate the bot response
|
1641 |
fn=generate_bot_response, inputs=[chatbot, choice, retrieval_mode, model_choice], outputs=[chatbot], api_name="api_generate_bot_response"
|
|
|
|
|
|
|
1642 |
).then(
|
1643 |
fn=clear_textbox, inputs=[], outputs=[chat_input], api_name="api_clear_textbox"
|
1644 |
)
|
|
|
1649 |
|
1650 |
|
1651 |
|
1652 |
+
|
1653 |
audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy', every=0.1)
|
1654 |
audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="api_voice_to_text")
|
1655 |
|