Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -572,28 +572,28 @@ with gr.Blocks(theme='rawrsor1/Everforest') as demo:
|
|
572 |
state = gr.State()
|
573 |
with gr.Row():
|
574 |
with gr.Column():
|
575 |
-
gr.Markdown("<h1>
|
576 |
-
choice = gr.Radio(label="
|
577 |
with gr.Column(): # Larger scale for the right column
|
578 |
-
gr.Markdown("<h1>
|
579 |
|
580 |
-
chat_input = gr.Textbox(show_copy_button=True, interactive=True, show_label=False, label="
|
581 |
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
|
582 |
bot_msg = chat_msg.then(bot, [chatbot, choice], [chatbot, gr.Audio(interactive=False, autoplay=True)])
|
583 |
-
bot_msg.then(lambda: gr.Textbox(value="", interactive=True, placeholder="
|
584 |
chatbot.like(print_like_dislike, None, None)
|
585 |
clear_button = gr.Button("Clear")
|
586 |
clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
|
587 |
|
588 |
with gr.Column(): # Smaller scale for the left column
|
589 |
-
gr.Markdown("<h1>
|
590 |
|
591 |
audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy')
|
592 |
audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="SAMLOne_real_time")
|
593 |
|
594 |
with gr.Row():
|
595 |
with gr.Column():
|
596 |
-
gr.Markdown("<h1>
|
597 |
location_output = gr.HTML()
|
598 |
bot_msg.then(show_map_if_details, [chatbot, choice], [location_output, location_output])
|
599 |
|
@@ -605,11 +605,11 @@ with gr.Blocks(theme='rawrsor1/Everforest') as demo:
|
|
605 |
with gr.Row():
|
606 |
|
607 |
with gr.Column():
|
608 |
-
gr.Markdown("<h1>
|
609 |
news_output = gr.HTML(value=fetch_local_events())
|
610 |
|
611 |
with gr.Column():
|
612 |
-
gr.Markdown("<h1>
|
613 |
image_output = gr.Image(value=generate_image(hardcoded_prompt))
|
614 |
|
615 |
setup_ui()
|
|
|
572 |
state = gr.State()
|
573 |
with gr.Row():
|
574 |
with gr.Column():
|
575 |
+
gr.Markdown("<h1>Select Style</h1>", elem_id="prompt-markdown")
|
576 |
+
choice = gr.Radio(label="Select Style", choices=["Details", "Conversational"], value="Conversational")
|
577 |
with gr.Column(): # Larger scale for the right column
|
578 |
+
gr.Markdown("<h1>Ask Radar !!!</h1>", elem_id="query-markdown")
|
579 |
|
580 |
+
chat_input = gr.Textbox(show_copy_button=True, interactive=True, show_label=False, label="ASK Radar !!!")
|
581 |
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
|
582 |
bot_msg = chat_msg.then(bot, [chatbot, choice], [chatbot, gr.Audio(interactive=False, autoplay=True)])
|
583 |
+
bot_msg.then(lambda: gr.Textbox(value="", interactive=True, placeholder="Ask Radar!!!...", show_label=False), None, [chat_input])
|
584 |
chatbot.like(print_like_dislike, None, None)
|
585 |
clear_button = gr.Button("Clear")
|
586 |
clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
|
587 |
|
588 |
with gr.Column(): # Smaller scale for the left column
|
589 |
+
gr.Markdown("<h1>Talk to RADAR</h1>", elem_id="voice-markdown")
|
590 |
|
591 |
audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy')
|
592 |
audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="SAMLOne_real_time")
|
593 |
|
594 |
with gr.Row():
|
595 |
with gr.Column():
|
596 |
+
gr.Markdown("<h1>Map</h1>", elem_id="location-markdown")
|
597 |
location_output = gr.HTML()
|
598 |
bot_msg.then(show_map_if_details, [chatbot, choice], [location_output, location_output])
|
599 |
|
|
|
605 |
with gr.Row():
|
606 |
|
607 |
with gr.Column():
|
608 |
+
gr.Markdown("<h1>Suggested Events</h1>", elem_id="events-markdown")
|
609 |
news_output = gr.HTML(value=fetch_local_events())
|
610 |
|
611 |
with gr.Column():
|
612 |
+
gr.Markdown("<h1>Sponsored</h1>", elem_id="image-markdown")
|
613 |
image_output = gr.Image(value=generate_image(hardcoded_prompt))
|
614 |
|
615 |
setup_ui()
|