Skip to content

Commit

Permalink
app.py error resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
narae committed Feb 5, 2024
1 parent 26a63bc commit 550cb95
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
25 changes: 21 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ def text2audio(
waveform = waveform[0]
return waveform

def share_js():
# Your JavaScript code goes here
print("Button clicked!")


css = """
a {
color: inherit;
Expand Down Expand Up @@ -223,7 +228,7 @@ def text2audio(
"""
)
with gr.Group():
with gr.Box():
with gr.Column():
############# Input
textbox = gr.Textbox(
value="A forest of wind chimes singing a soothing melody in the breeze.",
Expand Down Expand Up @@ -268,7 +273,8 @@ def text2audio(
# loading_icon = gr.HTML(loading_icon_html, visible=False)
# share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
# outputs=[gr.Audio(label="Output", type="numpy"), gr.Audio(label="Output", type="numpy")]
btn = gr.Button("Submit").style(full_width=True)
btn = gr.Button("Submit")
btn.css_class = "gr-btn-full-width"

with gr.Group(elem_id="share-btn-container", visible=False):
community_icon = gr.HTML(community_icon_html)
Expand All @@ -284,7 +290,11 @@ def text2audio(
api_name="text2audio",
)

share_button.click(None, [], [], _js=share_js)
#share_button.click(None, [], [], _js=share_js)
#gr.Button("Share to community", elem_id="share-btn", visible=False, onclick=share_js)

share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
share_button.click(None, [], [])
gr.HTML(
"""
<div class="footer" style="text-align: center; max-width: 700px; margin: 0 auto;">
Expand Down Expand Up @@ -357,7 +367,14 @@ def text2audio(
"""
)
# <p>This demo is strictly for research demo purpose only. For commercial use please <a href="[email protected]">contact us</a>.</p>
#iface.set_concurrency_limit(3)


iface.queue(concurrency_count=3)
#iface.queue(concurrency_count=3)
# iface.launch(debug=True)
#iface.launch(debug=True, share=True)

#iface.launch(debug=True, share=True, max_concurrency=3)

iface.launch(debug=True, share=True)

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"torchaudio>=0.13.0",
"torchvision>=0.14.0",
"tqdm",
"gradio",
"gradio<3",
"pyyaml",
"einops",
"chardet",
Expand Down

0 comments on commit 550cb95

Please sign in to comment.