Update app.py
Browse files
app.py
CHANGED
@@ -466,7 +466,7 @@ def generate_html(feed_items, scroll_to_latest=False, current_index=0, tag="", i
|
|
466 |
color: white;
|
467 |
font-family: Arial, sans-serif;
|
468 |
">
|
469 |
-
<p>
|
470 |
</div>
|
471 |
"""
|
472 |
|
@@ -557,18 +557,12 @@ with gr.Blocks(
|
|
557 |
# Input section
|
558 |
with gr.Column(elem_classes="gr-form"):
|
559 |
gr.Markdown("### Create Your Feed")
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
tag_input = gr.Textbox(
|
567 |
-
label="Or Enter a Custom Tag",
|
568 |
-
value="food",
|
569 |
-
placeholder="e.g., sushi, adventure",
|
570 |
-
submit_btn=False
|
571 |
-
)
|
572 |
magic_button = gr.Button("✨ Generate Next Item", elem_classes="gr-button")
|
573 |
|
574 |
# Output display
|
@@ -576,22 +570,7 @@ with gr.Blocks(
|
|
576 |
share_html = gr.HTML(label="Share this item:")
|
577 |
|
578 |
# Event handlers
|
579 |
-
|
580 |
-
"""Update the tag input when a suggested tag is selected and start the feed."""
|
581 |
-
return selected_tag
|
582 |
-
|
583 |
-
# Handle dropdown selection
|
584 |
-
suggested_tags.change(
|
585 |
-
fn=set_tag,
|
586 |
-
inputs=suggested_tags,
|
587 |
-
outputs=tag_input
|
588 |
-
).then(
|
589 |
-
fn=start_feed,
|
590 |
-
inputs=[tag_input, current_index, feed_items],
|
591 |
-
outputs=[current_tag, current_index, feed_items, feed_html, share_html, is_loading]
|
592 |
-
)
|
593 |
-
|
594 |
-
# Handle Enter keypress in the custom tag input
|
595 |
tag_input.submit(
|
596 |
fn=start_feed,
|
597 |
inputs=[tag_input, current_index, feed_items],
|
|
|
466 |
color: white;
|
467 |
font-family: Arial, sans-serif;
|
468 |
">
|
469 |
+
<p>Enter a concept or idea to start your feed!</p>
|
470 |
</div>
|
471 |
"""
|
472 |
|
|
|
557 |
# Input section
|
558 |
with gr.Column(elem_classes="gr-form"):
|
559 |
gr.Markdown("### Create Your Feed")
|
560 |
+
tag_input = gr.Textbox(
|
561 |
+
label="Enter Concept or Ideas", # Renamed label
|
562 |
+
value="",
|
563 |
+
placeholder="e.g., sushi adventure, neon tech", # Updated placeholder
|
564 |
+
submit_btn=False
|
565 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
566 |
magic_button = gr.Button("✨ Generate Next Item", elem_classes="gr-button")
|
567 |
|
568 |
# Output display
|
|
|
570 |
share_html = gr.HTML(label="Share this item:")
|
571 |
|
572 |
# Event handlers
|
573 |
+
# Handle Enter keypress in the concept input
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
574 |
tag_input.submit(
|
575 |
fn=start_feed,
|
576 |
inputs=[tag_input, current_index, feed_items],
|