Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -625,15 +625,6 @@ hardcoded_prompt_3 = "Create a high-energy scene of a DJ performing on a large s
|
|
625 |
# demo.queue()
|
626 |
# demo.launch(share=True)
|
627 |
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
with gr.Blocks(theme='rawrsor1/Everforest') as demo:
|
638 |
with gr.Row().style(equal_height=True):
|
639 |
with gr.Column(scale=2):
|
@@ -647,43 +638,53 @@ with gr.Blocks(theme='rawrsor1/Everforest') as demo:
|
|
647 |
image_output_2 = gr.Image(value=generate_image(hardcoded_prompt_2), width=300, height=300)
|
648 |
image_output_3 = gr.Image(value=generate_image(hardcoded_prompt_3), width=300, height=300)
|
649 |
|
650 |
-
|
651 |
-
|
652 |
-
with gr.
|
653 |
-
gr.
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
gr.
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
gr.
|
668 |
-
|
669 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
670 |
|
671 |
-
with gr.Row().style(equal_height=True):
|
672 |
-
with gr.Column(scale=1):
|
673 |
-
gr.Markdown("<h1>Map</h1>", elem_id="location-markdown")
|
674 |
-
location_output = gr.HTML()
|
675 |
-
bot_msg.then(show_map_if_details, [chatbot, choice], [location_output, location_output])
|
676 |
|
677 |
-
with gr.Row().style(equal_height=True):
|
678 |
-
with gr.Column(scale=1):
|
679 |
-
gr.Markdown("<h1>Suggested Events</h1>", elem_id="events-markdown")
|
680 |
-
news_output = gr.HTML(value=fetch_local_events())
|
681 |
|
682 |
-
with gr.Column(scale=1):
|
683 |
-
gr.Markdown("<h1>Omaha Today Headlines</h1>", elem_id="news-markdown")
|
684 |
-
news_output = gr.HTML(value=fetch_local_news())
|
685 |
|
686 |
-
demo.queue()
|
687 |
-
demo.launch(share=True)
|
688 |
|
689 |
|
|
|
625 |
# demo.queue()
|
626 |
# demo.launch(share=True)
|
627 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
628 |
with gr.Blocks(theme='rawrsor1/Everforest') as demo:
|
629 |
with gr.Row().style(equal_height=True):
|
630 |
with gr.Column(scale=2):
|
|
|
638 |
image_output_2 = gr.Image(value=generate_image(hardcoded_prompt_2), width=300, height=300)
|
639 |
image_output_3 = gr.Image(value=generate_image(hardcoded_prompt_3), width=300, height=300)
|
640 |
|
641 |
+
def setup_ui():
|
642 |
+
state = gr.State()
|
643 |
+
with gr.Row().style(equal_height=True):
|
644 |
+
with gr.Column(scale=1):
|
645 |
+
gr.Markdown("<h1>Select Style</h1>", elem_id="prompt-markdown")
|
646 |
+
choice = gr.Radio(label="Select Style", choices=["Details", "Conversational"], value="Conversational")
|
647 |
+
|
648 |
+
with gr.Column(scale=2): # Larger scale for the right column
|
649 |
+
gr.Markdown("<h1>Ask Radar !!!</h1>", elem_id="query-markdown")
|
650 |
+
chat_input = gr.Textbox(show_copy_button=True, interactive=True, show_label=False, label="ASK Radar !!!")
|
651 |
+
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
|
652 |
+
bot_msg = chat_msg.then(bot, [chatbot, choice], [chatbot, gr.Audio(interactive=False, autoplay=True)])
|
653 |
+
bot_msg.then(lambda: gr.Textbox(value="", interactive=True, placeholder="Ask Radar!!!...", show_label=False), None, [chat_input])
|
654 |
+
chatbot.like(print_like_dislike, None, None)
|
655 |
+
clear_button = gr.Button("Clear")
|
656 |
+
clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
|
657 |
+
|
658 |
+
with gr.Column(scale=1):
|
659 |
+
gr.Markdown("<h1>Talk to RADAR</h1>", elem_id="voice-markdown")
|
660 |
+
audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy')
|
661 |
+
audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="SAMLOne_real_time")
|
662 |
+
|
663 |
+
with gr.Row().style(equal_height=True):
|
664 |
+
with gr.Column(scale=1):
|
665 |
+
gr.Markdown("<h1>Map</h1>", elem_id="location-markdown")
|
666 |
+
location_output = gr.HTML()
|
667 |
+
bot_msg.then(show_map_if_details, [chatbot, choice], [location_output, location_output])
|
668 |
+
|
669 |
+
with gr.Row().style(equal_height=True):
|
670 |
+
with gr.Column(scale=1):
|
671 |
+
gr.Markdown("<h1>Suggested Events</h1>", elem_id="events-markdown")
|
672 |
+
events_output = gr.HTML(value=fetch_local_events())
|
673 |
+
|
674 |
+
with gr.Column(scale=1):
|
675 |
+
gr.Markdown("<h1>Omaha Today Headlines</h1>", elem_id="news-markdown")
|
676 |
+
news_output = gr.HTML(value=fetch_local_news())
|
677 |
+
|
678 |
+
setup_ui()
|
679 |
+
|
680 |
+
demo.queue()
|
681 |
+
demo.launch(share=True)
|
682 |
+
|
683 |
+
|
684 |
+
|
685 |
|
|
|
|
|
|
|
|
|
|
|
686 |
|
|
|
|
|
|
|
|
|
687 |
|
|
|
|
|
|
|
688 |
|
|
|
|
|
689 |
|
690 |
|