Update rvc.py (#1)
Browse files- Update rvc.py (cebf398c0c2d865d906c7c98cd75807ffbf4ef91)
Co-authored-by: nerpal <justyoung@users.noreply.huggingface.co>
rvc.py
CHANGED
|
@@ -87,7 +87,7 @@ with gr.Blocks(title="π Nex RVC Mobile",theme=gr.themes.Base()) as app:
|
|
| 87 |
|
| 88 |
record_button=gr.Microphone(label="OR Record audio.", type="filepath")
|
| 89 |
|
| 90 |
-
with gr.TabItem("
|
| 91 |
|
| 92 |
with gr.Row():
|
| 93 |
|
|
@@ -283,41 +283,7 @@ with gr.Blocks(title="π Nex RVC Mobile",theme=gr.themes.Base()) as app:
|
|
| 283 |
|
| 284 |
except: pass
|
| 285 |
|
| 286 |
-
with gr.Accordion("Processing Tools (Experimental)", open=True, visible=False):
|
| 287 |
|
| 288 |
-
audio_choice = gr.Radio(choices=["Input", "Output"], value="Output", label="Source",interactive=True)
|
| 289 |
-
|
| 290 |
-
with gr.Column():
|
| 291 |
-
|
| 292 |
-
stereo_button = gr.Button(value="Stereo", variant="primary")
|
| 293 |
-
|
| 294 |
-
stereo_button.click(
|
| 295 |
-
|
| 296 |
-
fn=stereo_process,
|
| 297 |
-
|
| 298 |
-
inputs=[input_player,output_player,audio_choice],
|
| 299 |
-
|
| 300 |
-
outputs=[output_player],
|
| 301 |
-
|
| 302 |
-
preprocess=True,
|
| 303 |
-
|
| 304 |
-
)
|
| 305 |
-
|
| 306 |
-
with gr.Column():
|
| 307 |
-
|
| 308 |
-
sr_button = gr.Button(value="SuperResolution", variant="primary", visible=False)
|
| 309 |
-
|
| 310 |
-
sr_button.click(
|
| 311 |
-
|
| 312 |
-
fn=sr_process,
|
| 313 |
-
|
| 314 |
-
inputs=[input_player,output_player,audio_choice],
|
| 315 |
-
|
| 316 |
-
outputs=[output_player],
|
| 317 |
-
|
| 318 |
-
preprocess=True,
|
| 319 |
-
|
| 320 |
-
)
|
| 321 |
|
| 322 |
file_index1 = gr.Textbox(
|
| 323 |
|
|
@@ -491,7 +457,7 @@ with gr.Blocks(title="π Nex RVC Mobile",theme=gr.themes.Base()) as app:
|
|
| 491 |
|
| 492 |
interactive=True,
|
| 493 |
|
| 494 |
-
visible=
|
| 495 |
|
| 496 |
)
|
| 497 |
|
|
@@ -531,9 +497,9 @@ with gr.Blocks(title="π Nex RVC Mobile",theme=gr.themes.Base()) as app:
|
|
| 531 |
|
| 532 |
easy_uploader = gr.Files(label="Drop your audio files here",file_types=['audio'])
|
| 533 |
|
| 534 |
-
|
| 535 |
|
| 536 |
-
|
| 537 |
|
| 538 |
easy_uploader.upload(inputs=[dataset_folder],outputs=[],fn=lambda folder:os.makedirs(folder,exist_ok=True))
|
| 539 |
|
|
@@ -581,17 +547,7 @@ with gr.Blocks(title="π Nex RVC Mobile",theme=gr.themes.Base()) as app:
|
|
| 581 |
|
| 582 |
)
|
| 583 |
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
preprocess_dataset,
|
| 587 |
-
|
| 588 |
-
[dataset_folder, training_name, sr2, np7],
|
| 589 |
-
|
| 590 |
-
[info1],
|
| 591 |
-
|
| 592 |
-
api_name="train_preprocess",
|
| 593 |
-
|
| 594 |
-
)
|
| 595 |
|
| 596 |
with gr.Column():
|
| 597 |
|
|
@@ -621,9 +577,7 @@ with gr.Blocks(title="π Nex RVC Mobile",theme=gr.themes.Base()) as app:
|
|
| 621 |
|
| 622 |
)
|
| 623 |
|
| 624 |
-
|
| 625 |
-
|
| 626 |
-
info2 = gr.Textbox(label="Information", value="", max_lines=8)
|
| 627 |
|
| 628 |
f0method8.change(
|
| 629 |
|
|
@@ -635,34 +589,7 @@ with gr.Blocks(title="π Nex RVC Mobile",theme=gr.themes.Base()) as app:
|
|
| 635 |
|
| 636 |
)
|
| 637 |
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
extract_f0_feature,
|
| 641 |
-
|
| 642 |
-
[
|
| 643 |
-
|
| 644 |
-
gpus6,
|
| 645 |
-
|
| 646 |
-
np7,
|
| 647 |
-
|
| 648 |
-
f0method8,
|
| 649 |
-
|
| 650 |
-
if_f0_3,
|
| 651 |
-
|
| 652 |
-
training_name,
|
| 653 |
-
|
| 654 |
-
version19,
|
| 655 |
-
|
| 656 |
-
gpus_rmvpe,
|
| 657 |
-
|
| 658 |
-
],
|
| 659 |
-
|
| 660 |
-
[info2],
|
| 661 |
-
|
| 662 |
-
api_name="train_extract_f0_feature",
|
| 663 |
-
|
| 664 |
-
)
|
| 665 |
-
|
| 666 |
with gr.Column():
|
| 667 |
|
| 668 |
total_epoch11 = gr.Slider(
|
|
@@ -681,6 +608,11 @@ with gr.Blocks(title="π Nex RVC Mobile",theme=gr.themes.Base()) as app:
|
|
| 681 |
|
| 682 |
)
|
| 683 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 684 |
but4 = gr.Button("3. Train Index", variant="primary")
|
| 685 |
|
| 686 |
but3 = gr.Button("4. Train Model", variant="primary")
|
|
@@ -761,7 +693,7 @@ with gr.Blocks(title="π Nex RVC Mobile",theme=gr.themes.Base()) as app:
|
|
| 761 |
|
| 762 |
interactive=True,
|
| 763 |
|
| 764 |
-
visible=
|
| 765 |
|
| 766 |
)
|
| 767 |
|
|
@@ -865,6 +797,44 @@ with gr.Blocks(title="π Nex RVC Mobile",theme=gr.themes.Base()) as app:
|
|
| 865 |
|
| 866 |
but5 = gr.Button("1 Click Training", variant="primary", visible=False)
|
| 867 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 868 |
but3.click(
|
| 869 |
|
| 870 |
click_train,
|
|
|
|
| 87 |
|
| 88 |
record_button=gr.Microphone(label="OR Record audio.", type="filepath")
|
| 89 |
|
| 90 |
+
with gr.TabItem("UVR", visible=False):
|
| 91 |
|
| 92 |
with gr.Row():
|
| 93 |
|
|
|
|
| 283 |
|
| 284 |
except: pass
|
| 285 |
|
|
|
|
| 286 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
|
| 288 |
file_index1 = gr.Textbox(
|
| 289 |
|
|
|
|
| 457 |
|
| 458 |
interactive=True,
|
| 459 |
|
| 460 |
+
visible=True
|
| 461 |
|
| 462 |
)
|
| 463 |
|
|
|
|
| 497 |
|
| 498 |
easy_uploader = gr.Files(label="Drop your audio files here",file_types=['audio'])
|
| 499 |
|
| 500 |
+
|
| 501 |
|
| 502 |
+
|
| 503 |
|
| 504 |
easy_uploader.upload(inputs=[dataset_folder],outputs=[],fn=lambda folder:os.makedirs(folder,exist_ok=True))
|
| 505 |
|
|
|
|
| 547 |
|
| 548 |
)
|
| 549 |
|
| 550 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 551 |
|
| 552 |
with gr.Column():
|
| 553 |
|
|
|
|
| 577 |
|
| 578 |
)
|
| 579 |
|
| 580 |
+
|
|
|
|
|
|
|
| 581 |
|
| 582 |
f0method8.change(
|
| 583 |
|
|
|
|
| 589 |
|
| 590 |
)
|
| 591 |
|
| 592 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 593 |
with gr.Column():
|
| 594 |
|
| 595 |
total_epoch11 = gr.Slider(
|
|
|
|
| 608 |
|
| 609 |
)
|
| 610 |
|
| 611 |
+
but1 = gr.Button("1. Process", variant="primary")
|
| 612 |
+
|
| 613 |
+
but2 = gr.Button("2. Extract Features", variant="primary")
|
| 614 |
+
|
| 615 |
+
|
| 616 |
but4 = gr.Button("3. Train Index", variant="primary")
|
| 617 |
|
| 618 |
but3 = gr.Button("4. Train Model", variant="primary")
|
|
|
|
| 693 |
|
| 694 |
interactive=True,
|
| 695 |
|
| 696 |
+
visible=True
|
| 697 |
|
| 698 |
)
|
| 699 |
|
|
|
|
| 797 |
|
| 798 |
but5 = gr.Button("1 Click Training", variant="primary", visible=False)
|
| 799 |
|
| 800 |
+
but1.click(
|
| 801 |
+
|
| 802 |
+
preprocess_dataset,
|
| 803 |
+
|
| 804 |
+
[dataset_folder, training_name, sr2, np7],
|
| 805 |
+
|
| 806 |
+
[info3],
|
| 807 |
+
|
| 808 |
+
api_name="train_preprocess",
|
| 809 |
+
|
| 810 |
+
)
|
| 811 |
+
|
| 812 |
+
but2.click(
|
| 813 |
+
extract_f0_feature,
|
| 814 |
+
[
|
| 815 |
+
gpus6,
|
| 816 |
+
|
| 817 |
+
np7,
|
| 818 |
+
|
| 819 |
+
f0method8,
|
| 820 |
+
|
| 821 |
+
if_f0_3,
|
| 822 |
+
|
| 823 |
+
training_name,
|
| 824 |
+
|
| 825 |
+
version19,
|
| 826 |
+
|
| 827 |
+
gpus_rmvpe,
|
| 828 |
+
|
| 829 |
+
],
|
| 830 |
+
|
| 831 |
+
[info3],
|
| 832 |
+
|
| 833 |
+
api_name="train_extract_f0_feature",
|
| 834 |
+
|
| 835 |
+
)
|
| 836 |
+
|
| 837 |
+
|
| 838 |
but3.click(
|
| 839 |
|
| 840 |
click_train,
|