fffiloni commited on
Commit
ebaa2ef
โ€ข
1 Parent(s): 6eac10a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -92,7 +92,7 @@ def get_music(pat, prompt, track_duration, gen_intensity, gen_mode):
92
  retries -= 1
93
  time.sleep(delay)
94
  response = requests.get(track, headers=headers)
95
- print(f"{response}")
96
  # Save the downloaded content to a local file
97
  with open(local_file_path, 'wb') as f:
98
  f.write(response.content)
@@ -118,6 +118,8 @@ def get_prompts(uploaded_image, track_duration, gen_intensity, gen_mode, openai_
118
  music_result = get_results(musical_prompt, track_duration, gen_intensity, gen_mode)
119
  else:
120
  music_result = get_results(prompt, track_duration, gen_intensity, gen_mode)
 
 
121
 
122
  show_prompts = f"""
123
  CLIP Interrogator Caption: '{prompt}'
@@ -183,7 +185,7 @@ def call_api(message, openai_api_key):
183
  presence_penalty=0.6
184
  )
185
 
186
- print(response)
187
 
188
  #return str(response.choices[0].text).split("\n",2)[2]
189
  return str(response.choices[0].text).lstrip('\n')
@@ -305,4 +307,4 @@ with gr.Blocks(css="style.css") as demo:
305
  generate.click(get_prompts, inputs=[input_img,track_duration,gen_intensity,gen_mode, openai_api_key], outputs=[prompts_out, music_output, share_button, community_icon, loading_icon], api_name="i2m")
306
  share_button.click(None, [], [], _js=share_js)
307
 
308
- demo.queue(max_size=32, concurrency_count=20).launch()
 
92
  retries -= 1
93
  time.sleep(delay)
94
  response = requests.get(track, headers=headers)
95
+ #print(f"{response}")
96
  # Save the downloaded content to a local file
97
  with open(local_file_path, 'wb') as f:
98
  f.write(response.content)
 
118
  music_result = get_results(musical_prompt, track_duration, gen_intensity, gen_mode)
119
  else:
120
  music_result = get_results(prompt, track_duration, gen_intensity, gen_mode)
121
+ else:
122
+ music_result = get_results(prompt, track_duration, gen_intensity, gen_mode)
123
 
124
  show_prompts = f"""
125
  CLIP Interrogator Caption: '{prompt}'
 
185
  presence_penalty=0.6
186
  )
187
 
188
+ #print(response)
189
 
190
  #return str(response.choices[0].text).split("\n",2)[2]
191
  return str(response.choices[0].text).lstrip('\n')
 
307
  generate.click(get_prompts, inputs=[input_img,track_duration,gen_intensity,gen_mode, openai_api_key], outputs=[prompts_out, music_output, share_button, community_icon, loading_icon], api_name="i2m")
308
  share_button.click(None, [], [], _js=share_js)
309
 
310
+ demo.queue(max_size=32).launch()