Spaces:
Runtime error
Runtime error
Commit
•
94795b0
1
Parent(s):
9b63141
Update app.py
Browse files
app.py
CHANGED
@@ -8,17 +8,20 @@ def download_html(content):
|
|
8 |
file.write(content)
|
9 |
return "content.html"
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
download_button = gr.DownloadButton(label="Download HTML")
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
18 |
|
19 |
-
|
20 |
-
fn=download_html,
|
21 |
-
inputs=html_component,
|
22 |
-
)
|
23 |
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
8 |
file.write(content)
|
9 |
return "content.html"
|
10 |
|
11 |
+
with gr.Blocks() as demo:
|
12 |
+
html_component = gr.HTML(generate_html)
|
13 |
+
download_button = gr.DownloadButton(label="Download HTML")
|
14 |
|
15 |
+
download_button.click(
|
16 |
+
fn=download_html,
|
17 |
+
inputs=html_component,
|
18 |
+
)
|
19 |
|
20 |
+
demo.launch()
|
|
|
|
|
|
|
21 |
|
22 |
+
# download_button = gr.DownloadButton(label="Download HTML", inputs=html_component, value=download_html)
|
23 |
+
# interface = gr.Interface(fn=generate_html,
|
24 |
+
# inputs=None,
|
25 |
+
# outputs=[html_component, download_button])
|
26 |
+
#
|
27 |
+
#interface.launch()
|