Spaces:
Paused
Paused
koby commited on
Commit ·
6dba9c7
1
Parent(s): 83e0dee
duration min 30 to 15
Browse files
app.py
CHANGED
|
@@ -169,7 +169,7 @@ def generate(style, lyrics, cot, seed, cfg_scale, duration, ending):
|
|
| 169 |
duration = int(duration) if duration else 120
|
| 170 |
except Exception:
|
| 171 |
duration = 120
|
| 172 |
-
duration = max(
|
| 173 |
exact = str(ending or "Exact").lower().startswith("exact")
|
| 174 |
if not exact:
|
| 175 |
# Natural: let the model finish on its own; close with a real [Outro]
|
|
@@ -249,7 +249,7 @@ with gr.Blocks(title="YuE2-3B Music") as demo:
|
|
| 249 |
seed = gr.Number(label="Seed", value=0, precision=0)
|
| 250 |
cfg = gr.Number(label="CFG scale (1.0 = default)", value=1.0, precision=2)
|
| 251 |
with gr.Row():
|
| 252 |
-
duration = gr.Slider(
|
| 253 |
ending = gr.Radio(["Exact", "Natural"], value="Exact", label="Ending", scale=2)
|
| 254 |
duration_txt = gr.Textbox(value="1:00 min", label="≈ time", scale=1, interactive=False)
|
| 255 |
btn = gr.Button("Generate song", variant="primary")
|
|
|
|
| 169 |
duration = int(duration) if duration else 120
|
| 170 |
except Exception:
|
| 171 |
duration = 120
|
| 172 |
+
duration = max(15, min(duration, 360))
|
| 173 |
exact = str(ending or "Exact").lower().startswith("exact")
|
| 174 |
if not exact:
|
| 175 |
# Natural: let the model finish on its own; close with a real [Outro]
|
|
|
|
| 249 |
seed = gr.Number(label="Seed", value=0, precision=0)
|
| 250 |
cfg = gr.Number(label="CFG scale (1.0 = default)", value=1.0, precision=2)
|
| 251 |
with gr.Row():
|
| 252 |
+
duration = gr.Slider(15, 360, value=60, step=10, label="Duration (seconds)", scale=3)
|
| 253 |
ending = gr.Radio(["Exact", "Natural"], value="Exact", label="Ending", scale=2)
|
| 254 |
duration_txt = gr.Textbox(value="1:00 min", label="≈ time", scale=1, interactive=False)
|
| 255 |
btn = gr.Button("Generate song", variant="primary")
|