Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -556,7 +556,7 @@ def generate_image(prompt):
|
|
| 556 |
|
| 557 |
# Hardcoded prompt for image generation
|
| 558 |
# hardcoded_prompt_1 = "Useing The top events like 'Summer Art Festival'and Date - 06/19/2024 ,Weather-Sunny Bright Day.Create Highly Visually Compelling High Resolution and High Quality Photographics Advatizement for 'Toyota'"
|
| 559 |
-
hardcoded_prompt_1="
|
| 560 |
hardcoded_prompt_2 = "Create a vibrant poster of Nebraska with beautiful weather, featuring picturesque landscapes, clear skies, and the word 'Nebraska' prominently displayed."
|
| 561 |
hardcoded_prompt_3 = "Create a high-energy scene of a DJ performing on a large stage with vibrant lights, colorful lasers, a lively dancing crowd, and various electronic equipment in the background."
|
| 562 |
|
|
@@ -635,27 +635,25 @@ hardcoded_prompt_3 = "Create a high-energy scene of a DJ performing on a large s
|
|
| 635 |
|
| 636 |
|
| 637 |
with gr.Blocks(theme='rawrsor1/Everforest') as demo:
|
| 638 |
-
with gr.Row():
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
weather_output = gr.HTML(value=fetch_local_weather())
|
| 642 |
|
| 643 |
-
with gr.Column():
|
| 644 |
-
gr.Markdown("<h1>Sponsored</h1>", elem_id="
|
|
|
|
|
|
|
| 645 |
image_output_1 = gr.Image(value=generate_image(hardcoded_prompt_1), width=300, height=300)
|
| 646 |
image_output_2 = gr.Image(value=generate_image(hardcoded_prompt_2), width=300, height=300)
|
| 647 |
image_output_3 = gr.Image(value=generate_image(hardcoded_prompt_3), width=300, height=300)
|
| 648 |
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
| 652 |
state = gr.State()
|
| 653 |
-
with gr.Row():
|
| 654 |
-
with gr.Column():
|
| 655 |
gr.Markdown("<h1>Select Style</h1>", elem_id="prompt-markdown")
|
| 656 |
choice = gr.Radio(label="Select Style", choices=["Details", "Conversational"], value="Conversational")
|
| 657 |
|
| 658 |
-
with gr.Column(): # Larger scale for the right column
|
| 659 |
gr.Markdown("<h1>Ask Radar !!!</h1>", elem_id="query-markdown")
|
| 660 |
chat_input = gr.Textbox(show_copy_button=True, interactive=True, show_label=False, label="ASK Radar !!!")
|
| 661 |
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
|
|
@@ -665,27 +663,27 @@ with gr.Blocks(theme='rawrsor1/Everforest') as demo:
|
|
| 665 |
clear_button = gr.Button("Clear")
|
| 666 |
clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
|
| 667 |
|
| 668 |
-
with gr.Column():
|
| 669 |
gr.Markdown("<h1>Talk to RADAR</h1>", elem_id="voice-markdown")
|
| 670 |
audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy')
|
| 671 |
audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="SAMLOne_real_time")
|
| 672 |
|
| 673 |
-
with gr.Row():
|
| 674 |
-
with gr.Column():
|
| 675 |
gr.Markdown("<h1>Map</h1>", elem_id="location-markdown")
|
| 676 |
location_output = gr.HTML()
|
| 677 |
bot_msg.then(show_map_if_details, [chatbot, choice], [location_output, location_output])
|
| 678 |
|
| 679 |
-
with gr.Row():
|
| 680 |
-
with gr.Column():
|
| 681 |
gr.Markdown("<h1>Suggested Events</h1>", elem_id="events-markdown")
|
| 682 |
news_output = gr.HTML(value=fetch_local_events())
|
| 683 |
|
| 684 |
-
with gr.Column():
|
|
|
|
| 685 |
news_output = gr.HTML(value=fetch_local_news())
|
| 686 |
|
| 687 |
demo.queue()
|
| 688 |
demo.launch(share=True)
|
| 689 |
|
| 690 |
|
| 691 |
-
|
|
|
|
| 556 |
|
| 557 |
# Hardcoded prompt for image generation
|
| 558 |
# hardcoded_prompt_1 = "Useing The top events like 'Summer Art Festival'and Date - 06/19/2024 ,Weather-Sunny Bright Day.Create Highly Visually Compelling High Resolution and High Quality Photographics Advatizement for 'Toyota'"
|
| 559 |
+
hardcoded_prompt_1="Give a high quality photograph of a great looking red 2026 toyota coupe against a skyline setting in th night, michael mann style in omaha enticing the consumer to buy this product"
|
| 560 |
hardcoded_prompt_2 = "Create a vibrant poster of Nebraska with beautiful weather, featuring picturesque landscapes, clear skies, and the word 'Nebraska' prominently displayed."
|
| 561 |
hardcoded_prompt_3 = "Create a high-energy scene of a DJ performing on a large stage with vibrant lights, colorful lasers, a lively dancing crowd, and various electronic equipment in the background."
|
| 562 |
|
|
|
|
| 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):
|
| 640 |
+
chatbot = gr.Chatbot([], elem_id="chatbot", bubble_full_width=False)
|
|
|
|
| 641 |
|
| 642 |
+
with gr.Column(scale=1):
|
| 643 |
+
gr.Markdown("<h1>Weather & Sponsored</h1>", elem_id="weather-sponsored-section")
|
| 644 |
+
weather_output = gr.HTML(value=fetch_local_weather())
|
| 645 |
+
gr.Markdown("<h2>Sponsored</h2>", elem_id="image-markdown")
|
| 646 |
image_output_1 = gr.Image(value=generate_image(hardcoded_prompt_1), width=300, height=300)
|
| 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 |
state = gr.State()
|
| 651 |
+
with gr.Row().style(equal_height=True):
|
| 652 |
+
with gr.Column(scale=1):
|
| 653 |
gr.Markdown("<h1>Select Style</h1>", elem_id="prompt-markdown")
|
| 654 |
choice = gr.Radio(label="Select Style", choices=["Details", "Conversational"], value="Conversational")
|
| 655 |
|
| 656 |
+
with gr.Column(scale=2): # Larger scale for the right column
|
| 657 |
gr.Markdown("<h1>Ask Radar !!!</h1>", elem_id="query-markdown")
|
| 658 |
chat_input = gr.Textbox(show_copy_button=True, interactive=True, show_label=False, label="ASK Radar !!!")
|
| 659 |
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
|
|
|
|
| 663 |
clear_button = gr.Button("Clear")
|
| 664 |
clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
|
| 665 |
|
| 666 |
+
with gr.Column(scale=1):
|
| 667 |
gr.Markdown("<h1>Talk to RADAR</h1>", elem_id="voice-markdown")
|
| 668 |
audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy')
|
| 669 |
audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="SAMLOne_real_time")
|
| 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 |
|
|
|