Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -67,7 +67,7 @@ def save_data(t,m,l,n,w,p):
|
|
67 |
repo_type="space",
|
68 |
)
|
69 |
#return f"https://broadfield-a.hf.space/?pdfurl={t}&mod={m}&len={l}&nos={n}&wid={w}&pau={p}"
|
70 |
-
return f"https://broadfield-a.static.hf.space/{title}.html"
|
71 |
def load_html(url):
|
72 |
html=f"""<iframe src="https://docs.google.com/viewer?url={url})&embedded=true" frameborder="0" height="1200px" width="100%"></iframe></div>"""
|
73 |
return html
|
@@ -186,6 +186,7 @@ with gr.Blocks(head=head,css=css) as app:
|
|
186 |
w=gr.Slider(label="Noise Width", minimum=0.01, maximum=3.0, value=0.5,interactive=True)
|
187 |
p=gr.Slider(label="Sentence Pause", minimum=0.1, maximum=10.0, value=1,interactive=True)
|
188 |
save=gr.Button("Save Data")
|
|
|
189 |
h=gr.HTML("""<div id='cap'></div>""")
|
190 |
with gr.Column(visible=False):
|
191 |
bulk=gr.Textbox(label="bulk",interactive=False,visible=True)
|
@@ -195,6 +196,6 @@ with gr.Blocks(head=head,css=css) as app:
|
|
195 |
mc=m.change(pp.load_mod,m,None)
|
196 |
bc=bulk.change(pp.stream_tts,[bulk,m,l,n,w,p],a)
|
197 |
uc=upd.click(pp.stream_tts,[bulk,m,l,n,w,p],a)
|
198 |
-
sb=save.click(save_data,[t,m,l,n,w,p],
|
199 |
sc=stp.click(None,None,None, cancels=[tc,mc,bc,uc])
|
200 |
app.queue(default_concurrency_limit=20).launch(max_threads=40)
|
|
|
67 |
repo_type="space",
|
68 |
)
|
69 |
#return f"https://broadfield-a.hf.space/?pdfurl={t}&mod={m}&len={l}&nos={n}&wid={w}&pau={p}"
|
70 |
+
return f"<div><a href='https://broadfield-a.static.hf.space/{title}.html' target='_blank'>https://broadfield-a.static.hf.space/{title}.html</a></div>"
|
71 |
def load_html(url):
|
72 |
html=f"""<iframe src="https://docs.google.com/viewer?url={url})&embedded=true" frameborder="0" height="1200px" width="100%"></iframe></div>"""
|
73 |
return html
|
|
|
186 |
w=gr.Slider(label="Noise Width", minimum=0.01, maximum=3.0, value=0.5,interactive=True)
|
187 |
p=gr.Slider(label="Sentence Pause", minimum=0.1, maximum=10.0, value=1,interactive=True)
|
188 |
save=gr.Button("Save Data")
|
189 |
+
save_html=gr.HTML()
|
190 |
h=gr.HTML("""<div id='cap'></div>""")
|
191 |
with gr.Column(visible=False):
|
192 |
bulk=gr.Textbox(label="bulk",interactive=False,visible=True)
|
|
|
196 |
mc=m.change(pp.load_mod,m,None)
|
197 |
bc=bulk.change(pp.stream_tts,[bulk,m,l,n,w,p],a)
|
198 |
uc=upd.click(pp.stream_tts,[bulk,m,l,n,w,p],a)
|
199 |
+
sb=save.click(save_data,[t,m,l,n,w,p],save_html)
|
200 |
sc=stp.click(None,None,None, cancels=[tc,mc,bc,uc])
|
201 |
app.queue(default_concurrency_limit=20).launch(max_threads=40)
|