Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -72,7 +72,7 @@ def get_music(pat, prompt, track_duration, gen_intensity, gen_mode):
|
|
72 |
|
73 |
rdata = json.loads(r.text)
|
74 |
|
75 |
-
print(f"rdata: {rdata}")
|
76 |
assert rdata['status'] == 1, rdata['error']['text']
|
77 |
track = rdata['data']['tasks'][0]['download_link']
|
78 |
print(track)
|
@@ -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 |
-
|
96 |
# Save the downloaded content to a local file
|
97 |
with open(local_file_path, 'wb') as f:
|
98 |
f.write(response.content)
|
@@ -295,7 +295,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
295 |
|
296 |
with gr.Accordion(label="Music Generation Options", open=False):
|
297 |
openai_api_key = gr.Textbox(type="password", label="π Your OpenAI API Key (optional)", placeholder="sk-123abc...", info="You can use your OpenAI key to adapt CLIP Interrogator caption to a musical translation.")
|
298 |
-
track_duration = gr.Slider(minimum=20, maximum=120, value=
|
299 |
with gr.Row():
|
300 |
gen_intensity = gr.Dropdown(choices=["low", "medium", "high"], value="medium", label="Intensity")
|
301 |
gen_mode = gr.Radio(label="mode", choices=["track", "loop"], value="loop")
|
|
|
72 |
|
73 |
rdata = json.loads(r.text)
|
74 |
|
75 |
+
#print(f"rdata: {rdata}")
|
76 |
assert rdata['status'] == 1, rdata['error']['text']
|
77 |
track = rdata['data']['tasks'][0]['download_link']
|
78 |
print(track)
|
|
|
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)
|
|
|
295 |
|
296 |
with gr.Accordion(label="Music Generation Options", open=False):
|
297 |
openai_api_key = gr.Textbox(type="password", label="π Your OpenAI API Key (optional)", placeholder="sk-123abc...", info="You can use your OpenAI key to adapt CLIP Interrogator caption to a musical translation.")
|
298 |
+
track_duration = gr.Slider(minimum=20, maximum=120, value=42, ustep=5, label="Track duration", elem_id="duration-inp")
|
299 |
with gr.Row():
|
300 |
gen_intensity = gr.Dropdown(choices=["low", "medium", "high"], value="medium", label="Intensity")
|
301 |
gen_mode = gr.Radio(label="mode", choices=["track", "loop"], value="loop")
|