Spaces:
Paused
Paused
koby commited on
Commit ·
1cb4c5d
1
Parent(s): 4a18a04
slider max to model real max 360s
Browse files
app.py
CHANGED
|
@@ -150,7 +150,7 @@ def generate(style, lyrics, cot, seed, cfg_scale, duration):
|
|
| 150 |
duration = int(duration) if duration else 120
|
| 151 |
except Exception:
|
| 152 |
duration = 120
|
| 153 |
-
duration = max(30, min(duration,
|
| 154 |
gen_kwargs = dict(style=style, lyrics=lyrics, cot=cot, seed=seed)
|
| 155 |
if cfg_scale and float(cfg_scale) != 1.0:
|
| 156 |
gen_kwargs["cfg_scale"] = float(cfg_scale)
|
|
@@ -202,7 +202,7 @@ with gr.Blocks(title="YuE2-3B Music") as demo:
|
|
| 202 |
seed = gr.Number(label="Seed", value=0, precision=0)
|
| 203 |
cfg = gr.Number(label="CFG scale (1.0 = default)", value=1.0, precision=2)
|
| 204 |
with gr.Row():
|
| 205 |
-
duration = gr.Slider(30,
|
| 206 |
duration_txt = gr.Textbox(value="2:00 min", label="≈ time", scale=1, interactive=False)
|
| 207 |
btn = gr.Button("Generate song", variant="primary")
|
| 208 |
with gr.Column():
|
|
|
|
| 150 |
duration = int(duration) if duration else 120
|
| 151 |
except Exception:
|
| 152 |
duration = 120
|
| 153 |
+
duration = max(30, min(duration, 360))
|
| 154 |
gen_kwargs = dict(style=style, lyrics=lyrics, cot=cot, seed=seed)
|
| 155 |
if cfg_scale and float(cfg_scale) != 1.0:
|
| 156 |
gen_kwargs["cfg_scale"] = float(cfg_scale)
|
|
|
|
| 202 |
seed = gr.Number(label="Seed", value=0, precision=0)
|
| 203 |
cfg = gr.Number(label="CFG scale (1.0 = default)", value=1.0, precision=2)
|
| 204 |
with gr.Row():
|
| 205 |
+
duration = gr.Slider(30, 360, value=120, step=10, label="Duration (seconds, exact)", scale=4)
|
| 206 |
duration_txt = gr.Textbox(value="2:00 min", label="≈ time", scale=1, interactive=False)
|
| 207 |
btn = gr.Button("Generate song", variant="primary")
|
| 208 |
with gr.Column():
|