forked from haoheliu/AudioLDM2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
narae
committed
Feb 5, 2024
1 parent
26a63bc
commit 550cb95
Showing
2 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -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.", | ||
|
@@ -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) | ||
|
@@ -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;"> | ||
|
@@ -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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters