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
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
import os

import re

import random

from scipy.io.wavfile import write
from scipy.io.wavfile import read

import numpy as np

import gradio as gr

import yt_dlp

import subprocess

from original import *

import shutil, glob, subprocess

from easyfuncs import download_from_url, CachedModels, whisperspeak, whisperspeak_on, stereo_process, sr_process

os.makedirs("dataset",exist_ok=True)

os.makedirs("audios",exist_ok=True)

model_library = CachedModels()





with gr.Blocks(title="🔊 Nex RVC Mobile",theme=gr.themes.Base()) as app:

    gr.Markdown("# Nex RVC MOBILE GUI")
    with gr.Tabs():
        voice_model = gr.Dropdown(label="AI Voice", choices=sorted(names), value=lambda:sorted(names)[0] if len(sorted(names)) > 0 else '', interactive=True)

        refresh_button = gr.Button("Search Again", variant="primary")


        with gr.TabItem("Inference"):

            with gr.Row():

                
                spk_item = gr.Slider(

                    minimum=0,

                    maximum=2333,

                    step=1,

                    label="Speaker ID",

                    value=0,

                    visible=False,

                    interactive=True,

                )

                vc_transform0 = gr.Number(

                    label="Pitch", 

                    value=0

                )

                but0 = gr.Button(value="Convert", variant="primary")

            with gr.Row():

                with gr.Column():

                    with gr.Tabs():

                        with gr.TabItem("Upload"):

                            dropbox = gr.File(label="Drop your audio here & hit the Reload button.")

                        with gr.TabItem("Record"):

                            record_button=gr.Microphone(label="OR Record audio.", type="filepath")

                        with gr.TabItem("UVR", visible=False):

                            with gr.Row():

                                tts_text = gr.Textbox(label="Text to Speech", placeholder="Enter text to convert to speech")

                            with gr.Row():

                                tts_lang = gr.Radio(choices=["en","es","it","pt"],label="",value="en")

                            with gr.Row():

                                tts_button = gr.Button(value="Speak", variant="primary")

                    with gr.Row():

                        paths_for_files = lambda path:[os.path.abspath(os.path.join(path, f)) for f in os.listdir(path) if os.path.splitext(f)[1].lower() in ('.mp3', '.wav', '.flac', '.ogg')]

                        input_audio0 = gr.Dropdown(

                            label="Input Path",

                            value=paths_for_files('audios')[0] if len(paths_for_files('audios')) > 0 else '',

                            choices=paths_for_files('audios'), # Only show absolute paths for audio files ending in .mp3, .wav, .flac or .ogg

                            allow_custom_value=True

                        )

                    with gr.Row():

                        input_player = gr.Audio(label="Input",type="numpy",interactive=False)

                        input_audio0.change(

                            inputs=[input_audio0],

                            outputs=[input_player],

                            fn=lambda path: {"value":path,"__type__":"update"} if os.path.exists(path) else None

                        )

                        record_button.stop_recording(

                            fn=lambda audio:audio, #TODO save wav lambda

                            inputs=[record_button], 

                            outputs=[input_audio0])

                        dropbox.upload(

                            fn=lambda audio:audio.name,

                            inputs=[dropbox], 

                            outputs=[input_audio0])

                        tts_button.click(

                            fn=whisperspeak,

                            inputs=[tts_text,tts_lang],

                            outputs=[input_audio0],

                            show_progress=True)

                        tts_button.click(

                            fn=lambda: {"choices":paths_for_files('audios'),"__type__":"update"},

                            inputs=[],

                            outputs=[input_audio0])

                with gr.Column():

                    with gr.Accordion("Change Index", open=False):

                        file_index2 = gr.Dropdown(

                            label="Change Index",

                            choices=sorted(index_paths),

                            interactive=True,

                            value=sorted(index_paths)[0] if len(sorted(index_paths)) > 0 else ''

                        )

                        index_rate1 = gr.Slider(

                            minimum=0,

                            maximum=1,

                            label="Index Strength",

                            value=0.5,

                            interactive=True,

                        )

                    output_player = gr.Audio(label="Output",interactive=False)

                    with gr.Accordion("General Settings", open=False):

                        f0method0 = gr.Radio(

                            label="Method",

                            choices=["pm"],

                            value="pm",

                            interactive=False,

                            visible=False,

                        )

                        filter_radius0 = gr.Slider(

                            minimum=0,

                            maximum=7,

                            label="Breathiness Reduction (Harvest only)",

                            value=3,

                            step=1,

                            interactive=True,

                        )

                        resample_sr0 = gr.Slider(

                            minimum=0,

                            maximum=48000,

                            label="Resample",

                            value=0,

                            step=1,

                            interactive=True,

                            visible=False

                        )

                        rms_mix_rate0 = gr.Slider(

                            minimum=0,

                            maximum=1,

                            label="Volume Normalization",

                            value=0,

                            interactive=True,

                        )

                        protect0 = gr.Slider(

                            minimum=0,

                            maximum=0.5,

                            label="Breathiness Protection (0 is enabled, 0.5 is disabled)",

                            value=0.33,

                            step=0.01,

                            interactive=True,

                        )

                        if voice_model != None: 

                            try: vc.get_vc(voice_model.value,protect0,protect0) #load the model immediately for faster inference

                            except: pass



                    file_index1 = gr.Textbox(

                        label="Index Path",

                        interactive=True,

                        visible=False#Not used here

                    )

                    refresh_button.click(

                        fn=change_choices,

                        inputs=[],

                        outputs=[voice_model, file_index2],

                        api_name="infer_refresh",

                    )

                    refresh_button.click(

                        fn=lambda:{"choices":paths_for_files('audios'),"__type__":"update"}, #TODO check if properly returns a sorted list of audio files in the 'audios' folder that have the extensions '.wav', '.mp3', '.ogg', or '.flac'

                        inputs=[],

                        outputs = [input_audio0],   

                    )

                    refresh_button.click(

                        fn=lambda:{"value":paths_for_files('audios')[0],"__type__":"update"} if len(paths_for_files('audios')) > 0 else {"value":"","__type__":"update"}, #TODO check if properly returns a sorted list of audio files in the 'audios' folder that have the extensions '.wav', '.mp3', '.ogg', or '.flac'

                        inputs=[],

                        outputs = [input_audio0],   

                    )

            with gr.Row():

                f0_file = gr.File(label="F0 Path", visible=False)

            with gr.Row():

                vc_output1 = gr.Textbox(label="Information", placeholder="Welcome!",visible=False)

                but0.click(

                    vc.vc_single,  

                    [

                        spk_item,

                        input_audio0,

                        vc_transform0,

                        f0_file,

                        f0method0,

                        file_index1,

                        file_index2,

                        index_rate1,

                        filter_radius0,

                        resample_sr0,

                        rms_mix_rate0,

                        protect0,

                    ],

                    [vc_output1, output_player],

                    api_name="infer_convert",

                )  

                voice_model.change(

                    fn=vc.get_vc,

                    inputs=[voice_model, protect0, protect0],

                    outputs=[spk_item, protect0, protect0, file_index2, file_index2],

                    api_name="infer_change_voice",

                )

        with gr.TabItem("Download Models"):

            with gr.Row():

                url_input = gr.Textbox(label="URL to model (i.e. from huggingface)", value="",placeholder="https://...", scale=6)

                name_output = gr.Textbox(label="Save as (if from hf, you may leave it blank)", value="",placeholder="MyModel",scale=2)

                url_download = gr.Button(value="Download Model",scale=2)

                url_download.click(

                    inputs=[url_input,name_output],

                    outputs=[url_input],

                    fn=download_from_url,

                )

            with gr.Row():

                model_browser = gr.Dropdown(choices=list(model_library.models.keys()),label="OR Search Models (Quality UNKNOWN)",scale=5)

                download_from_browser = gr.Button(value="Get",scale=2)

                download_from_browser.click(

                    inputs=[model_browser],

                    outputs=[model_browser],

                    fn=lambda model: download_from_url(model_library.models[model],model),

                )

        with gr.TabItem("Train"):

            with gr.Row():

                with gr.Column():

                    training_name = gr.Textbox(label="Name your model", value="My-Voice",placeholder="My-Voice")

                    np7 = gr.Slider(

                        minimum=0,

                        maximum=config.n_cpu,

                        step=1,

                        label="Number of CPU processes used to extract pitch features",

                        value=1,

                        interactive=False,

                        visible=False

                    )

                    sr2 = gr.Radio(

                        label="Sampling Rate",

                        choices=["40k", "32k"],

                        value="32k",

                        interactive=True,

                        visible=True

                    )

                    if_f0_3 = gr.Radio(

                        label="Will your model be used for singing? If not, you can ignore this.",

                        choices=[True, False],

                        value=True,

                        interactive=True,

                        visible=False

                    )

                    version19 = gr.Radio(

                        label="Version",

                        choices=["v1", "v2"],

                        value="v2",

                        interactive=True,

                        visible=False,

                    )

                    dataset_folder = gr.Textbox(

                        label="dataset folder", value='dataset'

                    )

                    easy_uploader = gr.Files(label="Drop your audio files here",file_types=['audio'])

                    

 

                    easy_uploader.upload(inputs=[dataset_folder],outputs=[],fn=lambda folder:os.makedirs(folder,exist_ok=True))

                    easy_uploader.upload(

                        fn=lambda files,folder: [shutil.copy2(f.name,os.path.join(folder,os.path.split(f.name)[1])) for f in files] if folder != "" else gr.Warning('Please enter a folder name for your dataset'),

                        inputs=[easy_uploader, dataset_folder], 

                        outputs=[])

                    gpus6 = gr.Textbox(

                        label="Enter the GPU numbers to use separated by -, (e.g. 0-1-2)",

                        value="",

                        interactive=True,

                        visible=False,

                    )

                    gpu_info9 = gr.Textbox(

                        label="GPU Info", value=gpu_info, visible=False

                    )

                    spk_id5 = gr.Slider(

                        minimum=0,

                        maximum=4,

                        step=1,

                        label="Speaker ID",

                        value=0,

                        interactive=True,

                        visible=False

                    )

                    

                with gr.Column():

                    f0method8 = gr.Radio(

                        label="F0 extraction method",

                        choices=["pm", "harvest", "dio", "rmvpe", "rmvpe_gpu"],

                        value="pm",

                        interactive=False,

                        visible=False

                    )

                    gpus_rmvpe = gr.Textbox(

                        label="GPU numbers to use separated by -, (e.g. 0-1-2)",

                        value="",

                        interactive=False,

                        visible=False,

                    )

                    

                    f0method8.change(

                        fn=change_f0_method,

                        inputs=[f0method8],

                        outputs=[gpus_rmvpe],

                    )

                   
                with gr.Column():

                    total_epoch11 = gr.Slider(

                        minimum=5,

                        maximum=1000,

                        step=5,

                        label="Epochs (more epochs may improve quality but takes longer)",

                        value=100,

                        interactive=True,

                    )

                    but1 = gr.Button("1. Process", variant="primary")

                    but2 = gr.Button("2. Extract Features", variant="primary")

                    
                    but4 = gr.Button("3. Train Index", variant="primary")

                    but3 = gr.Button("4. Train Model", variant="primary")

                    info3 = gr.Textbox(label="Information", value="", max_lines=10)

                    with gr.Accordion(label="General Settings", open=False):

                        gpus16 = gr.Textbox(

                            label="GPUs separated by -, (e.g. 0-1-2)",

                            value="0",

                            interactive=True,

                            visible=False,

                        )

                        save_epoch10 = gr.Slider(

                            minimum=1,

                            maximum=50,

                            step=1,

                            label="Weight Saving Frequency",

                            value=25,

                            interactive=True,

                            visible=False

                        )

                        batch_size12 = gr.Slider(

                            minimum=1,

                            maximum=40,

                            step=1,

                            label="Batch Size",

                            value=1,

                            interactive=True,

                            visible=False

                        )

                        if_save_latest13 = gr.Radio(

                            label="Only save the latest model",

                            choices=["yes", "no"],

                            value="yes",

                            interactive=True,

                            visible=False

                        )

                        if_cache_gpu17 = gr.Radio(

                            label="If your dataset is UNDER 10 minutes, cache it to train faster",

                            choices=["yes", "no"],

                            value="no",

                            interactive=True,

                            visible=True

                        )

                        if_save_every_weights18 = gr.Radio(

                            label="Save small model at every save point",

                            choices=["yes", "no"],

                            value="yes",

                            interactive=False,

                            visible=False

                        )

                        with gr.Accordion(label="Change pretrains", open=False):

                            pretrained = lambda sr, letter: [os.path.abspath(os.path.join('assets/pretrained_v2', file)) for file in os.listdir('assets/pretrained_v2') if file.endswith('.pth') and sr in file and letter in file]

                            pretrained_G14 = gr.Dropdown(

                                label="pretrained G",

                                # Get a list of all pretrained G model files in assets/pretrained_v2 that end with .pth

                                choices = pretrained(sr2.value, 'G'),

                                value=pretrained(sr2.value, 'G')[0] if len(pretrained(sr2.value, 'G')) > 0 else '',

                                interactive=True,

                                visible=True

                            )

                            pretrained_D15 = gr.Dropdown(

                                label="pretrained D",

                                choices = pretrained(sr2.value, 'D'),

                                value= pretrained(sr2.value, 'D')[0] if len(pretrained(sr2.value, 'G')) > 0 else '',

                                visible=True,

                                interactive=True

                            )

                    with gr.Row():

                        download_model = gr.Button('5.Download Model')

                    with gr.Row():

                        model_files = gr.Files(label='Your Model and Index file can be downloaded here:')

                        download_model.click(

                            fn=lambda name: os.listdir(f'assets/weights/{name}') + glob.glob(f'logs/{name.split(".")[0]}/added_*.index'),

                            inputs=[training_name], 

                            outputs=[model_files, info3])

                    with gr.Row():

                        sr2.change(

                            change_sr2,

                            [sr2, if_f0_3, version19],

                            [pretrained_G14, pretrained_D15],

                        )

                        version19.change(

                            change_version19,

                            [sr2, if_f0_3, version19],

                            [pretrained_G14, pretrained_D15, sr2],

                        )

                        if_f0_3.change(

                            change_f0,

                            [if_f0_3, sr2, version19],

                            [f0method8, pretrained_G14, pretrained_D15],

                        )

                    with gr.Row():

                        but5 = gr.Button("1 Click Training", variant="primary", visible=False)

                        but1.click(
                            
                            preprocess_dataset,
                            
                            [dataset_folder, training_name, sr2, np7],
                            
                            [info3],
                            
                            api_name="train_preprocess",
                        
                        ) 

                        but2.click(
                            extract_f0_feature,
                            [
                                gpus6,
                                
                                np7,
                                
                                f0method8,
                                
                                if_f0_3,
                                
                                training_name,
                                
                                version19,

                                gpus_rmvpe,
                            
                            ],
                            
                            [info3],
                            
                            api_name="train_extract_f0_feature",
                        
                        )


                        but3.click(

                            click_train,

                            [

                                training_name,

                                sr2,

                                if_f0_3,

                                spk_id5,

                                save_epoch10,

                                total_epoch11,

                                batch_size12,

                                if_save_latest13,

                                pretrained_G14,

                                pretrained_D15,

                                gpus16,

                                if_cache_gpu17,

                                if_save_every_weights18,

                                version19,

                            ],

                            info3,

                            api_name="train_start",

                        )

                        but4.click(train_index, [training_name, version19], info3)

                        but5.click(

                            train1key,

                            [

                                training_name,

                                sr2,

                                if_f0_3,

                                dataset_folder,

                                spk_id5,

                                np7,

                                f0method8,

                                save_epoch10,

                                total_epoch11,

                                batch_size12,

                                if_save_latest13,

                                pretrained_G14,

                                pretrained_D15,

                                gpus16,

                                if_cache_gpu17,

                                if_save_every_weights18,

                                version19,

                                gpus_rmvpe,

                            ],

                            info3,

                            api_name="train_start_all",

                        )



    if config.iscolab:

        app.queue(max_size=20).launch(share=True,allowed_paths=["a.png"],show_error=True)

    else:

        app.queue(max_size=1022).launch(

            server_name="0.0.0.0",

            inbrowser=not config.noautoopen,

            server_port=config.listen_port,

            quiet=True,

        )