Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -766,6 +766,49 @@ def update_images():
|
|
766 |
# demo.queue()
|
767 |
# demo.launch(share=True)
|
768 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
769 |
with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
770 |
with gr.Row():
|
771 |
with gr.Column():
|
@@ -783,9 +826,7 @@ with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
|
783 |
retriver_button.click(fn=add_message, inputs=[chatbot, chat_input], outputs=[chatbot, chat_input]).then(
|
784 |
fn=bot, inputs=[chatbot, choice, tts_choice, state], outputs=[chatbot, gr.Audio(interactive=False, autoplay=True)], api_name="Ask_Retriever")
|
785 |
|
786 |
-
# bot_msg = chat_msg.then(bot, [chatbot, choice, tts_choice], [chatbot, gr.Audio(interactive=False, autoplay=True], api_name="generate_voice_response")
|
787 |
bot_msg = chat_msg.then(bot, [chatbot, choice, tts_choice], [chatbot], api_name="generate_voice_response")
|
788 |
-
|
789 |
bot_msg.then(lambda: gr.Textbox(value="", interactive=True, placeholder="Ask Radar!!!...", show_label=False), None, [chat_input])
|
790 |
chatbot.like(print_like_dislike, None, None)
|
791 |
clear_button = gr.Button("Clear")
|
@@ -810,4 +851,3 @@ demo.queue()
|
|
810 |
demo.launch(share=True)
|
811 |
|
812 |
|
813 |
-
|
|
|
766 |
# demo.queue()
|
767 |
# demo.launch(share=True)
|
768 |
|
769 |
+
# with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
770 |
+
# with gr.Row():
|
771 |
+
# with gr.Column():
|
772 |
+
# state = gr.State()
|
773 |
+
|
774 |
+
# chatbot = gr.Chatbot([], elem_id="RADAR:Channel 94.1", bubble_full_width=False)
|
775 |
+
# choice = gr.Radio(label="Select Style", choices=["Details", "Conversational"], value="Conversational")
|
776 |
+
|
777 |
+
# gr.Markdown("<h1 style='color: red;'>Talk to RADAR</h1>", elem_id="voice-markdown")
|
778 |
+
|
779 |
+
# chat_input = gr.Textbox(show_copy_button=True, interactive=True, show_label=False, label="ASK Radar !!!")
|
780 |
+
# chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input], api_name="voice_query")
|
781 |
+
# tts_choice = gr.Radio(label="Select TTS System", choices=["Alpha", "Beta", "Gamma"], value="Alpha")
|
782 |
+
# retriver_button = gr.Button("Retriever")
|
783 |
+
# retriver_button.click(fn=add_message, inputs=[chatbot, chat_input], outputs=[chatbot, chat_input]).then(
|
784 |
+
# fn=bot, inputs=[chatbot, choice, tts_choice, state], outputs=[chatbot, gr.Audio(interactive=False, autoplay=True)], api_name="Ask_Retriever")
|
785 |
+
|
786 |
+
# # bot_msg = chat_msg.then(bot, [chatbot, choice, tts_choice], [chatbot, gr.Audio(interactive=False, autoplay=True], api_name="generate_voice_response")
|
787 |
+
# bot_msg = chat_msg.then(bot, [chatbot, choice, tts_choice], [chatbot], api_name="generate_voice_response")
|
788 |
+
|
789 |
+
# bot_msg.then(lambda: gr.Textbox(value="", interactive=True, placeholder="Ask Radar!!!...", show_label=False), None, [chat_input])
|
790 |
+
# chatbot.like(print_like_dislike, None, None)
|
791 |
+
# clear_button = gr.Button("Clear")
|
792 |
+
# clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
|
793 |
+
|
794 |
+
# audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy')
|
795 |
+
# audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="voice_query_to_text")
|
796 |
+
|
797 |
+
# gr.Markdown("<h1 style='color: red;'>Map</h1>", elem_id="location-markdown")
|
798 |
+
# location_output = gr.HTML()
|
799 |
+
# bot_msg.then(show_map_if_details, [chatbot, choice], [location_output, location_output], api_name="map_finder")
|
800 |
+
|
801 |
+
# with gr.Column():
|
802 |
+
# image_output_1 = gr.Image(value=generate_image(hardcoded_prompt_1), width=400, height=400)
|
803 |
+
# image_output_2 = gr.Image(value=generate_image(hardcoded_prompt_2), width=400, height=400)
|
804 |
+
# image_output_3 = gr.Image(value=generate_image(hardcoded_prompt_3), width=400, height=400)
|
805 |
+
|
806 |
+
# refresh_button = gr.Button("Refresh Images")
|
807 |
+
# refresh_button.click(fn=update_images, inputs=None, outputs=[image_output_1, image_output_2, image_output_3])
|
808 |
+
|
809 |
+
# demo.queue()
|
810 |
+
# demo.launch(share=True)
|
811 |
+
|
812 |
with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
813 |
with gr.Row():
|
814 |
with gr.Column():
|
|
|
826 |
retriver_button.click(fn=add_message, inputs=[chatbot, chat_input], outputs=[chatbot, chat_input]).then(
|
827 |
fn=bot, inputs=[chatbot, choice, tts_choice, state], outputs=[chatbot, gr.Audio(interactive=False, autoplay=True)], api_name="Ask_Retriever")
|
828 |
|
|
|
829 |
bot_msg = chat_msg.then(bot, [chatbot, choice, tts_choice], [chatbot], api_name="generate_voice_response")
|
|
|
830 |
bot_msg.then(lambda: gr.Textbox(value="", interactive=True, placeholder="Ask Radar!!!...", show_label=False), None, [chat_input])
|
831 |
chatbot.like(print_like_dislike, None, None)
|
832 |
clear_button = gr.Button("Clear")
|
|
|
851 |
demo.launch(share=True)
|
852 |
|
853 |
|
|