Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -27,10 +27,10 @@ def get_prompts(uploaded_image, track_duration, gen_intensity, gen_mode):
|
|
27 |
prompt = img_to_text(uploaded_image, 'fast', 4, fn_index=1)[0]
|
28 |
print(prompt)
|
29 |
pat = get_pat_token()
|
30 |
-
music_result = get_music(pat, prompt, track_duration, gen_intensity, gen_mode)
|
31 |
#music_result = generate_track_by_prompt(pat, prompt, track_duration, gen_intensity, gen_mode)
|
32 |
print(music_result)
|
33 |
-
return
|
34 |
|
35 |
#from utils import get_tags_for_prompts, get_mubert_tags_embeddings, get_pat
|
36 |
|
@@ -184,7 +184,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
184 |
|
185 |
input_img = gr.Image(type="filepath", elem_id="input-img")
|
186 |
music_output = gr.Audio(label="Result", type="filepath", elem_id="music-output").style(height="5rem")
|
187 |
-
|
188 |
with gr.Group(elem_id="share-btn-container"):
|
189 |
community_icon = gr.HTML(community_icon_html, visible=False)
|
190 |
loading_icon = gr.HTML(loading_icon_html, visible=False)
|
@@ -200,7 +200,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
200 |
|
201 |
gr.HTML(article)
|
202 |
|
203 |
-
generate.click(get_prompts, inputs=[input_img,track_duration,gen_intensity,gen_mode], outputs=[
|
204 |
share_button.click(None, [], [], _js=share_js)
|
205 |
|
206 |
demo.queue(max_size=32, concurrency_count=20).launch()
|
|
|
27 |
prompt = img_to_text(uploaded_image, 'fast', 4, fn_index=1)[0]
|
28 |
print(prompt)
|
29 |
pat = get_pat_token()
|
30 |
+
#music_result = get_music(pat, prompt, track_duration, gen_intensity, gen_mode)
|
31 |
#music_result = generate_track_by_prompt(pat, prompt, track_duration, gen_intensity, gen_mode)
|
32 |
print(music_result)
|
33 |
+
return pat, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
34 |
|
35 |
#from utils import get_tags_for_prompts, get_mubert_tags_embeddings, get_pat
|
36 |
|
|
|
184 |
|
185 |
input_img = gr.Image(type="filepath", elem_id="input-img")
|
186 |
music_output = gr.Audio(label="Result", type="filepath", elem_id="music-output").style(height="5rem")
|
187 |
+
text_status = gr.Textbox(label="status")
|
188 |
with gr.Group(elem_id="share-btn-container"):
|
189 |
community_icon = gr.HTML(community_icon_html, visible=False)
|
190 |
loading_icon = gr.HTML(loading_icon_html, visible=False)
|
|
|
200 |
|
201 |
gr.HTML(article)
|
202 |
|
203 |
+
generate.click(get_prompts, inputs=[input_img,track_duration,gen_intensity,gen_mode], outputs=[text_status, share_button, community_icon, loading_icon], api_name="i2m")
|
204 |
share_button.click(None, [], [], _js=share_js)
|
205 |
|
206 |
demo.queue(max_size=32, concurrency_count=20).launch()
|