Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed the launch issue by implementing gradio's latest version elements #66

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def text2audio(
"""
)
with gr.Group():
with gr.Box():
with gr.Blocks():
############# Input
textbox = gr.Textbox(
value="A forest of wind chimes singing a soothing melody in the breeze.",
Expand Down Expand Up @@ -268,7 +268,7 @@ 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", elem_id=".gr-Button")

with gr.Group(elem_id="share-btn-container", visible=False):
community_icon = gr.HTML(community_icon_html)
Expand All @@ -282,9 +282,10 @@ def text2audio(
inputs=[textbox, duration, guidance_scale, seed, n_candidates],
outputs=[outputs],
api_name="text2audio",
concurrency_limit=3
)

share_button.click(None, [], [], _js=share_js)
share_button.click(None, [], [], js=share_js)
gr.HTML(
"""
<div class="footer" style="text-align: center; max-width: 700px; margin: 0 auto;">
Expand Down Expand Up @@ -358,6 +359,7 @@ def text2audio(
)
# <p>This demo is strictly for research demo purpose only. For commercial use please <a href="haoheliu@gmail.com">contact us</a>.</p>

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