Spaces:
Running on Zero
Running on Zero
Describe what each control does to the sound
Browse files
app.py
CHANGED
|
@@ -405,7 +405,10 @@ if __name__ == "__main__":
|
|
| 405 |
label="input audio",
|
| 406 |
interactive=False,
|
| 407 |
type="numpy",
|
| 408 |
-
)
|
|
|
|
|
|
|
|
|
|
| 409 |
|
| 410 |
# audio_mask = gr.Audio(
|
| 411 |
# label="audio mask (listen to this to hear the mask hints)",
|
|
@@ -435,7 +438,12 @@ if __name__ == "__main__":
|
|
| 435 |
minimum=0,
|
| 436 |
maximum=13,
|
| 437 |
step=1,
|
| 438 |
-
value=7,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 439 |
)
|
| 440 |
|
| 441 |
onset_mask_width = gr.Slider(
|
|
@@ -461,6 +469,10 @@ if __name__ == "__main__":
|
|
| 461 |
minimum=1,
|
| 462 |
maximum=14,
|
| 463 |
step=1,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 464 |
)
|
| 465 |
|
| 466 |
dropout = gr.Slider(
|
|
@@ -468,7 +480,11 @@ if __name__ == "__main__":
|
|
| 468 |
minimum=0.0,
|
| 469 |
maximum=1.0,
|
| 470 |
step=0.01,
|
| 471 |
-
value=0.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 472 |
)
|
| 473 |
|
| 474 |
num_feedback_steps = gr.Slider(
|
|
@@ -482,7 +498,8 @@ if __name__ == "__main__":
|
|
| 482 |
preset_dropdown = gr.Dropdown(
|
| 483 |
label="preset",
|
| 484 |
choices=["timbre transfer", "small variation", "small variation (follow beat)", "medium variation", "medium variation (follow beat)", "large variation", "large variation (follow beat)", "unconditional"],
|
| 485 |
-
value="medium variation"
|
|
|
|
| 486 |
)
|
| 487 |
def change_preset(preset_dropdown):
|
| 488 |
if preset_dropdown == "timbre transfer":
|
|
@@ -554,6 +571,7 @@ if __name__ == "__main__":
|
|
| 554 |
maximum=12,
|
| 555 |
step=1,
|
| 556 |
value=0,
|
|
|
|
| 557 |
)
|
| 558 |
|
| 559 |
stretch_factor = gr.Slider(
|
|
@@ -561,7 +579,11 @@ if __name__ == "__main__":
|
|
| 561 |
minimum=0,
|
| 562 |
maximum=8,
|
| 563 |
step=1,
|
| 564 |
-
value=1,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 565 |
)
|
| 566 |
|
| 567 |
|
|
@@ -573,18 +595,30 @@ if __name__ == "__main__":
|
|
| 573 |
minimum=0.1,
|
| 574 |
maximum=10.0,
|
| 575 |
value=1.0,
|
| 576 |
-
step=0.001
|
|
|
|
|
|
|
|
|
|
|
|
|
| 577 |
)
|
| 578 |
|
| 579 |
top_p = gr.Slider(
|
| 580 |
label="top p (0.0 = off)",
|
| 581 |
minimum=0.0,
|
| 582 |
maximum=1.0,
|
| 583 |
-
value=0.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 584 |
)
|
| 585 |
typical_filtering = gr.Checkbox(
|
| 586 |
label="typical filtering ",
|
| 587 |
-
value=True
|
|
|
|
|
|
|
|
|
|
|
|
|
| 588 |
)
|
| 589 |
typical_mass = gr.Slider(
|
| 590 |
label="typical mass (should probably stay between 0.1 and 0.5)",
|
|
@@ -604,14 +638,19 @@ if __name__ == "__main__":
|
|
| 604 |
minimum=0.0,
|
| 605 |
maximum=0.9,
|
| 606 |
value=1.0,
|
| 607 |
-
step=0.01
|
|
|
|
|
|
|
|
|
|
|
|
|
| 608 |
)
|
| 609 |
sampling_steps = gr.Slider(
|
| 610 |
label="sampling steps",
|
| 611 |
minimum=1,
|
| 612 |
maximum=128,
|
| 613 |
step=1,
|
| 614 |
-
value=36
|
|
|
|
| 615 |
)
|
| 616 |
|
| 617 |
|
|
@@ -620,6 +659,10 @@ if __name__ == "__main__":
|
|
| 620 |
label="seed (0 for random)",
|
| 621 |
value=0,
|
| 622 |
precision=0,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 623 |
)
|
| 624 |
|
| 625 |
|
|
@@ -630,7 +673,11 @@ if __name__ == "__main__":
|
|
| 630 |
label="model choice",
|
| 631 |
choices=list(interface.available_models()),
|
| 632 |
value=init_model_choice,
|
| 633 |
-
visible=True
|
|
|
|
|
|
|
|
|
|
|
|
|
| 634 |
)
|
| 635 |
|
| 636 |
|
|
|
|
| 405 |
label="input audio",
|
| 406 |
interactive=False,
|
| 407 |
type="numpy",
|
| 408 |
+
).set_info((
|
| 409 |
+
"The audio to rework. The model fills in what it masks out, so the "
|
| 410 |
+
"result keeps the character of this recording."
|
| 411 |
+
))
|
| 412 |
|
| 413 |
# audio_mask = gr.Audio(
|
| 414 |
# label="audio mask (listen to this to hear the mask hints)",
|
|
|
|
| 438 |
minimum=0,
|
| 439 |
maximum=13,
|
| 440 |
step=1,
|
| 441 |
+
value=7,
|
| 442 |
+
info=(
|
| 443 |
+
"How much of the original is kept as a guide. Low values keep more "
|
| 444 |
+
"and stay closer to the input; high values free the model to depart "
|
| 445 |
+
"from it."
|
| 446 |
+
),
|
| 447 |
)
|
| 448 |
|
| 449 |
onset_mask_width = gr.Slider(
|
|
|
|
| 469 |
minimum=1,
|
| 470 |
maximum=14,
|
| 471 |
step=1,
|
| 472 |
+
info=(
|
| 473 |
+
"Keeps only the coarsest detail of the original, discarding fine "
|
| 474 |
+
"timbre. Raise it for a looser reinterpretation."
|
| 475 |
+
),
|
| 476 |
)
|
| 477 |
|
| 478 |
dropout = gr.Slider(
|
|
|
|
| 480 |
minimum=0.0,
|
| 481 |
maximum=1.0,
|
| 482 |
step=0.01,
|
| 483 |
+
value=0.0,
|
| 484 |
+
info=(
|
| 485 |
+
"Randomly drops parts of the guide, which loosens the result "
|
| 486 |
+
"without changing the overall amount kept."
|
| 487 |
+
)
|
| 488 |
)
|
| 489 |
|
| 490 |
num_feedback_steps = gr.Slider(
|
|
|
|
| 498 |
preset_dropdown = gr.Dropdown(
|
| 499 |
label="preset",
|
| 500 |
choices=["timbre transfer", "small variation", "small variation (follow beat)", "medium variation", "medium variation (follow beat)", "large variation", "large variation (follow beat)", "unconditional"],
|
| 501 |
+
value="medium variation",
|
| 502 |
+
info="Loads a set of the controls below that is known to work together."
|
| 503 |
)
|
| 504 |
def change_preset(preset_dropdown):
|
| 505 |
if preset_dropdown == "timbre transfer":
|
|
|
|
| 571 |
maximum=12,
|
| 572 |
step=1,
|
| 573 |
value=0,
|
| 574 |
+
info="Shifts the input before processing. Twelve is one octave.",
|
| 575 |
)
|
| 576 |
|
| 577 |
stretch_factor = gr.Slider(
|
|
|
|
| 579 |
minimum=0,
|
| 580 |
maximum=8,
|
| 581 |
step=1,
|
| 582 |
+
value=1,
|
| 583 |
+
info=(
|
| 584 |
+
"Stretches the input before processing. Values above one slow it "
|
| 585 |
+
"down."
|
| 586 |
+
),
|
| 587 |
)
|
| 588 |
|
| 589 |
|
|
|
|
| 595 |
minimum=0.1,
|
| 596 |
maximum=10.0,
|
| 597 |
value=1.0,
|
| 598 |
+
step=0.001,
|
| 599 |
+
info=(
|
| 600 |
+
"How adventurous the choices are. Higher values wander further and "
|
| 601 |
+
"can lose the beat."
|
| 602 |
+
)
|
| 603 |
)
|
| 604 |
|
| 605 |
top_p = gr.Slider(
|
| 606 |
label="top p (0.0 = off)",
|
| 607 |
minimum=0.0,
|
| 608 |
maximum=1.0,
|
| 609 |
+
value=0.0,
|
| 610 |
+
info=(
|
| 611 |
+
"Restricts choices to the most likely ones. Lower values are safer "
|
| 612 |
+
"and more repetitive."
|
| 613 |
+
)
|
| 614 |
)
|
| 615 |
typical_filtering = gr.Checkbox(
|
| 616 |
label="typical filtering ",
|
| 617 |
+
value=True,
|
| 618 |
+
info=(
|
| 619 |
+
"An alternative to top p that keeps choices of average likelihood, "
|
| 620 |
+
"avoiding both the safest and the strangest."
|
| 621 |
+
)
|
| 622 |
)
|
| 623 |
typical_mass = gr.Slider(
|
| 624 |
label="typical mass (should probably stay between 0.1 and 0.5)",
|
|
|
|
| 638 |
minimum=0.0,
|
| 639 |
maximum=0.9,
|
| 640 |
value=1.0,
|
| 641 |
+
step=0.01,
|
| 642 |
+
info=(
|
| 643 |
+
"Stops sampling early, leaving later detail to the decoder. Lower "
|
| 644 |
+
"values are smoother and less detailed."
|
| 645 |
+
)
|
| 646 |
)
|
| 647 |
sampling_steps = gr.Slider(
|
| 648 |
label="sampling steps",
|
| 649 |
minimum=1,
|
| 650 |
maximum=128,
|
| 651 |
step=1,
|
| 652 |
+
value=36,
|
| 653 |
+
info="More steps give a more considered result and take longer."
|
| 654 |
)
|
| 655 |
|
| 656 |
|
|
|
|
| 659 |
label="seed (0 for random)",
|
| 660 |
value=0,
|
| 661 |
precision=0,
|
| 662 |
+
info=(
|
| 663 |
+
"Fixes the result, so the same seed and settings give the same "
|
| 664 |
+
"output."
|
| 665 |
+
),
|
| 666 |
)
|
| 667 |
|
| 668 |
|
|
|
|
| 673 |
label="model choice",
|
| 674 |
choices=list(interface.available_models()),
|
| 675 |
value=init_model_choice,
|
| 676 |
+
visible=True,
|
| 677 |
+
info=(
|
| 678 |
+
"Which fine-tune to use. Each was trained on different material, "
|
| 679 |
+
"named in the model card."
|
| 680 |
+
)
|
| 681 |
)
|
| 682 |
|
| 683 |
|