Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -318,25 +318,25 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 318 |
clear.click(lambda: [], None, chatbot, queue=False)
|
| 319 |
clear.click(lambda: "", None, msg, queue=False)
|
| 320 |
|
| 321 |
-
# "Download My Story" row
|
| 322 |
-
with gr.Row():
|
| 323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 324 |
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
visible=True
|
| 332 |
-
)
|
| 333 |
-
|
| 334 |
-
save_btn.click(
|
| 335 |
-
fn=save_story,
|
| 336 |
-
inputs=[chatbot],
|
| 337 |
-
outputs=story_output,
|
| 338 |
-
queue=False # Process immediately
|
| 339 |
-
)
|
| 340 |
|
| 341 |
# Initialize buttons with default fantasy genre examples
|
| 342 |
initial_examples = get_examples_for_genre("fantasy")
|
|
|
|
| 318 |
clear.click(lambda: [], None, chatbot, queue=False)
|
| 319 |
clear.click(lambda: "", None, msg, queue=False)
|
| 320 |
|
| 321 |
+
# "Download My Story" row
|
| 322 |
+
with gr.Row():
|
| 323 |
+
save_btn = gr.Button("Download My Story", variant="secondary")
|
| 324 |
+
|
| 325 |
+
with gr.Column(scale=1, min_width=150): # Adjust width to make it smaller
|
| 326 |
+
story_output = gr.File(
|
| 327 |
+
label="Download your story",
|
| 328 |
+
file_count="single",
|
| 329 |
+
file_types=[".md"],
|
| 330 |
+
interactive=False,
|
| 331 |
+
visible=True
|
| 332 |
+
)
|
| 333 |
|
| 334 |
+
save_btn.click(
|
| 335 |
+
fn=save_story,
|
| 336 |
+
inputs=[chatbot],
|
| 337 |
+
outputs=story_output,
|
| 338 |
+
queue=False # Process immediately
|
| 339 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 340 |
|
| 341 |
# Initialize buttons with default fantasy genre examples
|
| 342 |
initial_examples = get_examples_for_genre("fantasy")
|