Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -801,12 +801,14 @@ with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
|
| 801 |
gr.Markdown("<h1 style='color: red;'>Talk to RADAR</h1>", elem_id="voice-markdown")
|
| 802 |
chat_input = gr.Textbox(show_copy_button=True, interactive=True, show_label=False, label="ASK Radar !!!")
|
| 803 |
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
|
| 804 |
-
bot_msg = chat_msg.then(bot, [chatbot, choice, tts_choice], [chatbot, gr.Audio(interactive=False, autoplay=True), gr.Button(
|
| 805 |
bot_msg.then(lambda: gr.Textbox(value="", interactive=True, placeholder="Ask Radar!!!...", show_label=False), None, [chat_input])
|
| 806 |
|
| 807 |
-
|
| 808 |
-
|
| 809 |
-
|
|
|
|
|
|
|
| 810 |
chatbot.like(print_like_dislike, None, None)
|
| 811 |
clear_button = gr.Button("Clear")
|
| 812 |
clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
|
|
|
|
| 801 |
gr.Markdown("<h1 style='color: red;'>Talk to RADAR</h1>", elem_id="voice-markdown")
|
| 802 |
chat_input = gr.Textbox(show_copy_button=True, interactive=True, show_label=False, label="ASK Radar !!!")
|
| 803 |
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
|
| 804 |
+
bot_msg = chat_msg.then(bot, [chatbot, choice, tts_choice], [chatbot, gr.Audio(interactive=False, autoplay=True), gr.Button("Follow-up Question 1", visible=False), gr.Button("Follow-up Question 2", visible=False)])
|
| 805 |
bot_msg.then(lambda: gr.Textbox(value="", interactive=True, placeholder="Ask Radar!!!...", show_label=False), None, [chat_input])
|
| 806 |
|
| 807 |
+
follow_up_button_1 = gr.Button("Follow-up Question 1", visible=False)
|
| 808 |
+
follow_up_button_2 = gr.Button("Follow-up Question 2", visible=False)
|
| 809 |
+
follow_up_button_1.click(handle_follow_up_choice, inputs=[follow_up_button_1, chatbot], outputs=[chatbot, follow_up_button_1, follow_up_button_2])
|
| 810 |
+
follow_up_button_2.click(handle_follow_up_choice, inputs=[follow_up_button_2, chatbot], outputs=[chatbot, follow_up_button_1, follow_up_button_2])
|
| 811 |
+
|
| 812 |
chatbot.like(print_like_dislike, None, None)
|
| 813 |
clear_button = gr.Button("Clear")
|
| 814 |
clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
|