albertvillanova HF staff commited on
Commit
94795b0
1 Parent(s): 9b63141

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -11
app.py CHANGED
@@ -8,17 +8,20 @@ def download_html(content):
8
  file.write(content)
9
  return "content.html"
10
 
11
- html_component = gr.HTML(generate_html)
12
- # download_button = gr.DownloadButton(label="Download HTML", inputs=html_component, value=download_html)
13
- download_button = gr.DownloadButton(label="Download HTML")
14
 
15
- interface = gr.Interface(fn=generate_html,
16
- inputs=None,
17
- outputs=[html_component, download_button])
 
18
 
19
- download_button.click(
20
- fn=download_html,
21
- inputs=html_component,
22
- )
23
 
24
- interface.launch()
 
 
 
 
 
 
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()