fffiloni commited on
Commit
fb859d5
โ€ข
1 Parent(s): 1a5805d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -121,7 +121,7 @@ def get_prompts(uploaded_image, track_duration, gen_intensity, gen_mode, openai_
121
  #wave_file = convert_mp3_to_wav(music_result[1])
122
 
123
  time.sleep(1)
124
- return gr.update(value=music_result[1], info=music_result[2]), gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
125
 
126
  def try_api(message, openai_api_key):
127
 
@@ -275,6 +275,7 @@ with gr.Blocks(css="style.css") as demo:
275
 
276
  input_img = gr.Image(type="filepath", elem_id="input-img")
277
  music_output = gr.Audio(label="Result", type="filepath", elem_id="music-output").style(height="5rem")
 
278
  #text_status = gr.Textbox(label="status")
279
  with gr.Group(elem_id="share-btn-container"):
280
  community_icon = gr.HTML(community_icon_html, visible=False)
@@ -292,7 +293,7 @@ with gr.Blocks(css="style.css") as demo:
292
 
293
  gr.HTML(article)
294
 
295
- generate.click(get_prompts, inputs=[input_img,track_duration,gen_intensity,gen_mode, openai_api_key], outputs=[music_output, share_button, community_icon, loading_icon], api_name="i2m")
296
  share_button.click(None, [], [], _js=share_js)
297
 
298
  demo.queue(max_size=32, concurrency_count=20).launch()
 
121
  #wave_file = convert_mp3_to_wav(music_result[1])
122
 
123
  time.sleep(1)
124
+ return music_result[1],music_result[2], gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
125
 
126
  def try_api(message, openai_api_key):
127
 
 
275
 
276
  input_img = gr.Image(type="filepath", elem_id="input-img")
277
  music_output = gr.Audio(label="Result", type="filepath", elem_id="music-output").style(height="5rem")
278
+ music_url = gr.Textbox(info="If player do not work, try to copy/paste the link in a new browser window")
279
  #text_status = gr.Textbox(label="status")
280
  with gr.Group(elem_id="share-btn-container"):
281
  community_icon = gr.HTML(community_icon_html, visible=False)
 
293
 
294
  gr.HTML(article)
295
 
296
+ generate.click(get_prompts, inputs=[input_img,track_duration,gen_intensity,gen_mode, openai_api_key], outputs=[music_output, music_url, share_button, community_icon, loading_icon], api_name="i2m")
297
  share_button.click(None, [], [], _js=share_js)
298
 
299
  demo.queue(max_size=32, concurrency_count=20).launch()