Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -197,7 +197,20 @@ def get_storyteller_avatar_url():
|
|
| 197 |
# Using an external wizard avatar image
|
| 198 |
return "https://api.dicebear.com/7.x/bottts/svg?seed=wizard&backgroundColor=b6e3f4&eyes=bulging"
|
| 199 |
|
| 200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
# Header section with improved instructions
|
| 202 |
gr.Markdown("""
|
| 203 |
# 🔮 AI Story Studio
|
|
@@ -317,19 +330,24 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 317 |
clear.click(lambda: [], None, chatbot, queue=False)
|
| 318 |
clear.click(lambda: "", None, msg, queue=False)
|
| 319 |
|
| 320 |
-
# "Download My Story" row
|
| 321 |
-
with gr.Row():
|
| 322 |
-
|
|
|
|
|
|
|
| 323 |
|
| 324 |
-
|
|
|
|
| 325 |
story_output = gr.File(
|
| 326 |
-
label=
|
| 327 |
file_count="single",
|
| 328 |
file_types=[".md"],
|
| 329 |
interactive=False,
|
| 330 |
-
visible=True
|
|
|
|
| 331 |
)
|
| 332 |
|
|
|
|
| 333 |
save_btn.click(
|
| 334 |
fn=save_story,
|
| 335 |
inputs=[chatbot],
|
|
|
|
| 197 |
# Using an external wizard avatar image
|
| 198 |
return "https://api.dicebear.com/7.x/bottts/svg?seed=wizard&backgroundColor=b6e3f4&eyes=bulging"
|
| 199 |
|
| 200 |
+
# Add this before your gr.Blocks definition
|
| 201 |
+
custom_css = """
|
| 202 |
+
.compact-file-output > div {
|
| 203 |
+
min-height: 0 !important;
|
| 204 |
+
padding: 0 !important;
|
| 205 |
+
}
|
| 206 |
+
.compact-file-output .file-preview {
|
| 207 |
+
margin: 0 !important;
|
| 208 |
+
display: flex;
|
| 209 |
+
align-items: center;
|
| 210 |
+
}
|
| 211 |
+
"""
|
| 212 |
+
|
| 213 |
+
with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo:
|
| 214 |
# Header section with improved instructions
|
| 215 |
gr.Markdown("""
|
| 216 |
# 🔮 AI Story Studio
|
|
|
|
| 330 |
clear.click(lambda: [], None, chatbot, queue=False)
|
| 331 |
clear.click(lambda: "", None, msg, queue=False)
|
| 332 |
|
| 333 |
+
# "Download My Story" row with improved layout
|
| 334 |
+
with gr.Row(equal_height=True): # Force equal height for all children
|
| 335 |
+
# Use Column for the button to control width
|
| 336 |
+
with gr.Column(scale=4):
|
| 337 |
+
save_btn = gr.Button("Download My Story", variant="secondary", size="lg")
|
| 338 |
|
| 339 |
+
# Use Column for the file output with matching height
|
| 340 |
+
with gr.Column(scale=1):
|
| 341 |
story_output = gr.File(
|
| 342 |
+
label=None, # Remove the label that adds extra height
|
| 343 |
file_count="single",
|
| 344 |
file_types=[".md"],
|
| 345 |
interactive=False,
|
| 346 |
+
visible=True,
|
| 347 |
+
elem_classes="compact-file-output" # Optional: for custom CSS styling
|
| 348 |
)
|
| 349 |
|
| 350 |
+
# Connect the save button to the save_story function
|
| 351 |
save_btn.click(
|
| 352 |
fn=save_story,
|
| 353 |
inputs=[chatbot],
|