Spaces:
Running
Running
default mp3, remove format selector, increase LM timeout to 900s
Browse files
app.py
CHANGED
|
@@ -87,7 +87,7 @@ def _run_pipeline(caption, lyrics, bpm, duration, seed, steps, output_format,
|
|
| 87 |
if adapter:
|
| 88 |
req["adapter"] = adapter
|
| 89 |
|
| 90 |
-
fmt = output_format if output_format in ("wav", "mp3") else "
|
| 91 |
synth_fmt = "wav16" if fmt == "wav" else "mp3"
|
| 92 |
suffix = f".{fmt}"
|
| 93 |
|
|
@@ -101,7 +101,7 @@ def _run_pipeline(caption, lyrics, bpm, duration, seed, steps, output_format,
|
|
| 101 |
|
| 102 |
if progress_cb:
|
| 103 |
progress_cb("lm_poll", {"job_id": lm_job_id})
|
| 104 |
-
lm_status, lm_elapsed = _poll_job(lm_job_id, timeout=
|
| 105 |
if lm_status != "done":
|
| 106 |
raise RuntimeError(f"LM {lm_status} after {lm_elapsed:.0f}s")
|
| 107 |
|
|
@@ -235,7 +235,7 @@ def gradio_main():
|
|
| 235 |
|
| 236 |
# -- Generate tab handler --
|
| 237 |
def generate_music(caption, lyrics, instrumental, bpm, duration, seed,
|
| 238 |
-
steps,
|
| 239 |
if not _server_ok():
|
| 240 |
return None, "ace-server not running. Check logs."
|
| 241 |
|
|
@@ -266,7 +266,7 @@ def gradio_main():
|
|
| 266 |
duration=duration,
|
| 267 |
seed=actual_seed,
|
| 268 |
steps=steps,
|
| 269 |
-
output_format=
|
| 270 |
progress_cb=gr_progress,
|
| 271 |
)
|
| 272 |
return audio_path, status
|
|
@@ -502,10 +502,6 @@ finally:
|
|
| 502 |
value=8, step=1, scale=1,
|
| 503 |
)
|
| 504 |
seed = gr.Number(label="Seed (-1=random)", value=-1, scale=1)
|
| 505 |
-
output_format = gr.Radio(
|
| 506 |
-
label="Format", choices=["wav", "mp3"],
|
| 507 |
-
value="wav", scale=1,
|
| 508 |
-
)
|
| 509 |
|
| 510 |
with gr.Row(elem_classes="compact-row"):
|
| 511 |
gen_btn = gr.Button("Generate Music", variant="primary", scale=2)
|
|
@@ -514,7 +510,7 @@ finally:
|
|
| 514 |
gen_btn.click(
|
| 515 |
fn=generate_music,
|
| 516 |
inputs=[caption, lyrics, instrumental, bpm, duration,
|
| 517 |
-
seed, steps
|
| 518 |
outputs=[audio_out, status],
|
| 519 |
api_name="generate",
|
| 520 |
)
|
|
|
|
| 87 |
if adapter:
|
| 88 |
req["adapter"] = adapter
|
| 89 |
|
| 90 |
+
fmt = output_format if output_format in ("wav", "mp3") else "mp3"
|
| 91 |
synth_fmt = "wav16" if fmt == "wav" else "mp3"
|
| 92 |
suffix = f".{fmt}"
|
| 93 |
|
|
|
|
| 101 |
|
| 102 |
if progress_cb:
|
| 103 |
progress_cb("lm_poll", {"job_id": lm_job_id})
|
| 104 |
+
lm_status, lm_elapsed = _poll_job(lm_job_id, timeout=900)
|
| 105 |
if lm_status != "done":
|
| 106 |
raise RuntimeError(f"LM {lm_status} after {lm_elapsed:.0f}s")
|
| 107 |
|
|
|
|
| 235 |
|
| 236 |
# -- Generate tab handler --
|
| 237 |
def generate_music(caption, lyrics, instrumental, bpm, duration, seed,
|
| 238 |
+
steps, progress=gr.Progress(track_tqdm=True)):
|
| 239 |
if not _server_ok():
|
| 240 |
return None, "ace-server not running. Check logs."
|
| 241 |
|
|
|
|
| 266 |
duration=duration,
|
| 267 |
seed=actual_seed,
|
| 268 |
steps=steps,
|
| 269 |
+
output_format="mp3",
|
| 270 |
progress_cb=gr_progress,
|
| 271 |
)
|
| 272 |
return audio_path, status
|
|
|
|
| 502 |
value=8, step=1, scale=1,
|
| 503 |
)
|
| 504 |
seed = gr.Number(label="Seed (-1=random)", value=-1, scale=1)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 505 |
|
| 506 |
with gr.Row(elem_classes="compact-row"):
|
| 507 |
gen_btn = gr.Button("Generate Music", variant="primary", scale=2)
|
|
|
|
| 510 |
gen_btn.click(
|
| 511 |
fn=generate_music,
|
| 512 |
inputs=[caption, lyrics, instrumental, bpm, duration,
|
| 513 |
+
seed, steps],
|
| 514 |
outputs=[audio_out, status],
|
| 515 |
api_name="generate",
|
| 516 |
)
|