Spaces:
Sleeping
Sleeping
Update save button
Browse files
app.py
CHANGED
|
@@ -128,6 +128,7 @@ with gr.Blocks(css=css_styles) as demo:
|
|
| 128 |
def save_as_pdf(html_content):
|
| 129 |
# Define path for temporary HTML and PDF files
|
| 130 |
html_path = "output_recipe.html"
|
|
|
|
| 131 |
|
| 132 |
# Write the HTML content to a temporary HTML file
|
| 133 |
with open(html_path, 'w') as f:
|
|
@@ -144,7 +145,7 @@ with gr.Blocks(css=css_styles) as demo:
|
|
| 144 |
|
| 145 |
play_button.click(fn=play_music, inputs=[], outputs=[background_music, background_music])
|
| 146 |
|
| 147 |
-
save_pdf_button.click(fn=save_as_pdf, inputs=output_recipe, outputs=[])
|
| 148 |
|
| 149 |
clear_button.click(fn=reset, inputs=[], outputs=[mood, sweetness, sour, savory, bitter, flavor_association, drinking_experience, soberness_level, allergies, additional_requests, output_recipe, play_button, background_music, save_pdf_button])
|
| 150 |
|
|
|
|
| 128 |
def save_as_pdf(html_content):
|
| 129 |
# Define path for temporary HTML and PDF files
|
| 130 |
html_path = "output_recipe.html"
|
| 131 |
+
pdf_path = "output_recipe.pdf"
|
| 132 |
|
| 133 |
# Write the HTML content to a temporary HTML file
|
| 134 |
with open(html_path, 'w') as f:
|
|
|
|
| 145 |
|
| 146 |
play_button.click(fn=play_music, inputs=[], outputs=[background_music, background_music])
|
| 147 |
|
| 148 |
+
save_pdf_button.click(fn=save_as_pdf, inputs=[output_recipe], outputs=[])
|
| 149 |
|
| 150 |
clear_button.click(fn=reset, inputs=[], outputs=[mood, sweetness, sour, savory, bitter, flavor_association, drinking_experience, soberness_level, allergies, additional_requests, output_recipe, play_button, background_music, save_pdf_button])
|
| 151 |
|