fffiloni commited on
Commit
b0f9db1
โ€ข
1 Parent(s): 5ab821b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -96,13 +96,13 @@ def get_music(pat, prompt, track_duration, gen_intensity, gen_mode):
96
  # Save the downloaded content to a local file
97
  with open(local_file_path, 'wb') as f:
98
  f.write(response.content)
99
- return "sample.mp3"
100
 
101
 
102
  def get_results(text_prompt,track_duration,gen_intensity,gen_mode):
103
  pat_token = get_pat_token()
104
  music = get_music(pat_token, text_prompt, track_duration, gen_intensity, gen_mode)
105
- return pat_token, music
106
 
107
  def get_prompts(uploaded_image, track_duration, gen_intensity, gen_mode, openai_api_key):
108
  print("calling clip interrogator")
@@ -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 music_result[1], gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
125
 
126
  def try_api(message, openai_api_key):
127
 
 
96
  # Save the downloaded content to a local file
97
  with open(local_file_path, 'wb') as f:
98
  f.write(response.content)
99
+ return "sample.mp3", track
100
 
101
 
102
  def get_results(text_prompt,track_duration,gen_intensity,gen_mode):
103
  pat_token = get_pat_token()
104
  music = get_music(pat_token, text_prompt, track_duration, gen_intensity, gen_mode)
105
+ return pat_token, music[0], music[1]
106
 
107
  def get_prompts(uploaded_image, track_duration, gen_intensity, gen_mode, openai_api_key):
108
  print("calling clip interrogator")
 
121
  #wave_file = convert_mp3_to_wav(music_result[1])
122
 
123
  time.sleep(1)
124
+ return gr.update.Audio(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