Spaces:
Running on Zero
Running on Zero
Update webui.py
Browse files
webui.py
CHANGED
|
@@ -275,16 +275,16 @@ def transcription_function(
|
|
| 275 |
def synthesis_function(
|
| 276 |
prompt_audio,
|
| 277 |
target_audio,
|
| 278 |
-
prompt_metadata,
|
| 279 |
-
target_metadata,
|
| 280 |
-
control,
|
| 281 |
-
auto_shift,
|
| 282 |
-
pitch_shift,
|
| 283 |
-
seed,
|
| 284 |
-
prompt_lyric_lang,
|
| 285 |
-
target_lyric_lang,
|
| 286 |
-
prompt_vocal_sep,
|
| 287 |
-
target_vocal_sep,
|
| 288 |
):
|
| 289 |
"""Single-button: runs transcription first if metadata not provided, then synthesis."""
|
| 290 |
try:
|
|
@@ -353,6 +353,7 @@ def synthesis_function(
|
|
| 353 |
return None, gr.update(), gr.update()
|
| 354 |
|
| 355 |
|
|
|
|
| 356 |
def render_interface() -> gr.Blocks:
|
| 357 |
with gr.Blocks(title="SoulX-Singer", theme=gr.themes.Default()) as page:
|
| 358 |
gr.HTML(
|
|
@@ -387,20 +388,13 @@ def render_interface() -> gr.Blocks:
|
|
| 387 |
editable=False,
|
| 388 |
interactive=True,
|
| 389 |
)
|
| 390 |
-
gr.Examples(
|
| 391 |
-
examples=["raven.wav"],
|
| 392 |
-
inputs=[prompt_audio]
|
| 393 |
-
)
|
| 394 |
target_audio = gr.Audio(
|
| 395 |
label="Target audio (melody / lyrics source), max 60s",
|
| 396 |
type="filepath",
|
| 397 |
editable=False,
|
| 398 |
interactive=True,
|
| 399 |
)
|
| 400 |
-
|
| 401 |
-
examples=["happy_birthday.mp3"],
|
| 402 |
-
inputs=[target_audio]
|
| 403 |
-
)
|
| 404 |
with gr.Row():
|
| 405 |
control_radio = gr.Radio(
|
| 406 |
choices=["melody", "score"],
|
|
@@ -508,6 +502,21 @@ def render_interface() -> gr.Blocks:
|
|
| 508 |
type="filepath",
|
| 509 |
interactive=False,
|
| 510 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 511 |
|
| 512 |
# ── Event handlers ──
|
| 513 |
transcription_btn.click(
|
|
|
|
| 275 |
def synthesis_function(
|
| 276 |
prompt_audio,
|
| 277 |
target_audio,
|
| 278 |
+
prompt_metadata=None,
|
| 279 |
+
target_metadata=None,
|
| 280 |
+
control="score",
|
| 281 |
+
auto_shift=True,
|
| 282 |
+
pitch_shift=0,
|
| 283 |
+
seed=12306,
|
| 284 |
+
prompt_lyric_lang="English",
|
| 285 |
+
target_lyric_lang="English",
|
| 286 |
+
prompt_vocal_sep=True,
|
| 287 |
+
target_vocal_sep=True,
|
| 288 |
):
|
| 289 |
"""Single-button: runs transcription first if metadata not provided, then synthesis."""
|
| 290 |
try:
|
|
|
|
| 353 |
return None, gr.update(), gr.update()
|
| 354 |
|
| 355 |
|
| 356 |
+
|
| 357 |
def render_interface() -> gr.Blocks:
|
| 358 |
with gr.Blocks(title="SoulX-Singer", theme=gr.themes.Default()) as page:
|
| 359 |
gr.HTML(
|
|
|
|
| 388 |
editable=False,
|
| 389 |
interactive=True,
|
| 390 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 391 |
target_audio = gr.Audio(
|
| 392 |
label="Target audio (melody / lyrics source), max 60s",
|
| 393 |
type="filepath",
|
| 394 |
editable=False,
|
| 395 |
interactive=True,
|
| 396 |
)
|
| 397 |
+
|
|
|
|
|
|
|
|
|
|
| 398 |
with gr.Row():
|
| 399 |
control_radio = gr.Radio(
|
| 400 |
choices=["melody", "score"],
|
|
|
|
| 502 |
type="filepath",
|
| 503 |
interactive=False,
|
| 504 |
)
|
| 505 |
+
gr.Examples(
|
| 506 |
+
examples=[
|
| 507 |
+
["raven.wav", "happy_birthday.mp3"],
|
| 508 |
+
["anita.wav", "happy_birthday.mp3"],
|
| 509 |
+
["obama.wav", "happy_birthday.mp3"],
|
| 510 |
+
["raven.wav", "everybody_loves.wav"],
|
| 511 |
+
["anita.wav", "everybody_loves.wav"],
|
| 512 |
+
["obama.wav", "everybody_loves.wav"],
|
| 513 |
+
],
|
| 514 |
+
inputs=[prompt_audio, target_audio],
|
| 515 |
+
outputs=output_audio,
|
| 516 |
+
fn=synthesis_function,
|
| 517 |
+
cache_examples=True,
|
| 518 |
+
cache_mode="lazy"
|
| 519 |
+
)
|
| 520 |
|
| 521 |
# ── Event handlers ──
|
| 522 |
transcription_btn.click(
|