LaynzID12 commited on
Commit
fcb78f6
1 Parent(s): 44870ce

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -555
app.py CHANGED
@@ -1,558 +1,4 @@
1
  import os
2
- import glob
3
- import json
4
- import traceback
5
- import logging
6
- import gradio as gr
7
- import numpy as np
8
- import librosa
9
- import torch
10
- import asyncio
11
- import edge_tts
12
- import sys
13
- import io
14
-
15
- from datetime import datetime
16
- from lib.config.config import Config
17
- from lib.vc.vc_infer_pipeline import VC
18
- from lib.vc.settings import change_audio_mode
19
- from lib.vc.audio import load_audio
20
- from lib.infer_pack.models import (
21
- SynthesizerTrnMs256NSFsid,
22
- SynthesizerTrnMs256NSFsid_nono,
23
- SynthesizerTrnMs768NSFsid,
24
- SynthesizerTrnMs768NSFsid_nono,
25
- )
26
- from lib.vc.utils import (
27
- combine_vocal_and_inst,
28
- cut_vocal_and_inst,
29
- download_audio,
30
- load_hubert
31
- )
32
 
33
  os.system("aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt -d . -o hubert_base.pt")
34
- os.system("aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/rmvpe.pt -d . -o rmvpe.pt")
35
-
36
-
37
-
38
- config = Config()
39
- logging.getLogger("numba").setLevel(logging.WARNING)
40
- logger = logging.getLogger(__name__)
41
- spaces = os.getenv("SYSTEM") == "spaces"
42
- force_support = None
43
- if config.unsupported is False:
44
- if config.device == "mps" or config.device == "cpu":
45
- force_support = False
46
- else:
47
- force_support = True
48
-
49
- audio_mode = []
50
- f0method_mode = []
51
- f0method_info = ""
52
- hubert_model = load_hubert(config)
53
-
54
- if force_support is False or spaces is True:
55
- if spaces is True:
56
- audio_mode = ["Upload audio", "TTS Audio"]
57
- else:
58
- audio_mode = ["Input path", "Upload audio", "TTS Audio"]
59
- f0method_mode = ["pm", "harvest"]
60
- f0method_info = "PM is fast, Harvest is good but extremely slow, Rvmpe is alternative to harvest (might be better). (Default: PM)"
61
- else:
62
- audio_mode = ["Input path", "Upload audio", "Youtube", "TTS Audio"]
63
- f0method_mode = ["pm", "harvest", "crepe"]
64
- f0method_info = "PM is fast, Harvest is good but extremely slow, Rvmpe is alternative to harvest (might be better), and Crepe effect is good but requires GPU (Default: PM)"
65
-
66
- if os.path.isfile("rmvpe.pt"):
67
- f0method_mode.insert(2, "rmvpe")
68
-
69
- def create_vc_fn(model_name, tgt_sr, net_g, vc, if_f0, version, file_index):
70
- def vc_fn(
71
- vc_audio_mode,
72
- vc_input,
73
- vc_upload,
74
- tts_text,
75
- tts_voice,
76
- f0_up_key,
77
- f0_method,
78
- index_rate,
79
- filter_radius,
80
- resample_sr,
81
- rms_mix_rate,
82
- protect,
83
- ):
84
- try:
85
- logs = []
86
- logger.info(f"Converting using {model_name}...")
87
- logs.append(f"Converting using {model_name}...")
88
- yield "\n".join(logs), None
89
- if vc_audio_mode == "Input path" or "Youtube" and vc_input != "":
90
- audio = load_audio(vc_input, 16000)
91
- audio_max = np.abs(audio).max() / 0.95
92
- if audio_max > 1:
93
- audio /= audio_max
94
- elif vc_audio_mode == "Upload audio":
95
- if vc_upload is None:
96
- return "You need to upload an audio", None
97
- sampling_rate, audio = vc_upload
98
- duration = audio.shape[0] / sampling_rate
99
- if duration > 20 and spaces:
100
- return "Please upload an audio file that is less than 20 seconds. If you need to generate a longer audio file, please use Colab.", None
101
- audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
102
- if len(audio.shape) > 1:
103
- audio = librosa.to_mono(audio.transpose(1, 0))
104
- if sampling_rate != 16000:
105
- audio = librosa.resample(audio, orig_sr=sampling_rate, target_sr=16000)
106
- elif vc_audio_mode == "TTS Audio":
107
- if len(tts_text) > 100 and spaces:
108
- return "Text is too long", None
109
- if tts_text is None or tts_voice is None:
110
- return "You need to enter text and select a voice", None
111
- os.makedirs("output", exist_ok=True)
112
- os.makedirs(os.path.join("output", "tts"), exist_ok=True)
113
- asyncio.run(edge_tts.Communicate(tts_text, "-".join(tts_voice.split('-')[:-1])).save(os.path.join("output", "tts", "tts.mp3")))
114
- audio, sr = librosa.load(os.path.join("output", "tts", "tts.mp3"), sr=16000, mono=True)
115
- vc_input = os.path.join("output", "tts", "tts.mp3")
116
- times = [0, 0, 0]
117
- f0_up_key = int(f0_up_key)
118
- audio_opt = vc.pipeline(
119
- hubert_model,
120
- net_g,
121
- 0,
122
- audio,
123
- vc_input,
124
- times,
125
- f0_up_key,
126
- f0_method,
127
- file_index,
128
- # file_big_npy,
129
- index_rate,
130
- if_f0,
131
- filter_radius,
132
- tgt_sr,
133
- resample_sr,
134
- rms_mix_rate,
135
- version,
136
- protect,
137
- f0_file=None,
138
- )
139
- info = f"[{datetime.now().strftime('%Y-%m-%d %H:%M')}]: npy: {times[0]}, f0: {times[1]}s, infer: {times[2]}s"
140
- logger.info(f"{model_name} | {info}")
141
- logs.append(f"Successfully Convert {model_name}\n{info}")
142
- yield "\n".join(logs), (tgt_sr, audio_opt)
143
- except Exception as err:
144
- info = traceback.format_exc()
145
- logger.error(info)
146
- logger.error(f"Error when using {model_name}.\n{str(err)}")
147
- yield info, None
148
- return vc_fn
149
-
150
- def load_model():
151
- categories = []
152
- category_count = 0
153
- if os.path.isfile("weights/folder_info.json"):
154
- with open("weights/folder_info.json", "r", encoding="utf-8") as f:
155
- folder_info = json.load(f)
156
- for category_name, category_info in folder_info.items():
157
- if not category_info['enable']:
158
- continue
159
- category_title = category_info['title']
160
- category_folder = category_info['folder_path']
161
- description = category_info['description']
162
- models = []
163
- with open(f"weights/{category_folder}/model_info.json", "r", encoding="utf-8") as f:
164
- models_info = json.load(f)
165
- for character_name, info in models_info.items():
166
- if not info['enable']:
167
- continue
168
- model_title = info['title']
169
- model_name = info['model_path']
170
- model_author = info.get("author", None)
171
- model_cover = f"weights/{category_folder}/{character_name}/{info['cover']}"
172
- model_index = f"weights/{category_folder}/{character_name}/{info['feature_retrieval_library']}"
173
- cpt = torch.load(f"weights/{category_folder}/{character_name}/{model_name}", map_location="cpu")
174
- tgt_sr = cpt["config"][-1]
175
- cpt["config"][-3] = cpt["weight"]["emb_g.weight"].shape[0] # n_spk
176
- if_f0 = cpt.get("f0", 1)
177
- version = cpt.get("version", "v1")
178
- if version == "v1":
179
- if if_f0 == 1:
180
- net_g = SynthesizerTrnMs256NSFsid(*cpt["config"], is_half=config.is_half)
181
- else:
182
- net_g = SynthesizerTrnMs256NSFsid_nono(*cpt["config"])
183
- model_version = "V1"
184
- elif version == "v2":
185
- if if_f0 == 1:
186
- net_g = SynthesizerTrnMs768NSFsid(*cpt["config"], is_half=config.is_half)
187
- else:
188
- net_g = SynthesizerTrnMs768NSFsid_nono(*cpt["config"])
189
- model_version = "V2"
190
- del net_g.enc_q
191
- logger.info(net_g.load_state_dict(cpt["weight"], strict=False))
192
- net_g.eval().to(config.device)
193
- if config.is_half:
194
- net_g = net_g.half()
195
- else:
196
- net_g = net_g.float()
197
- vc = VC(tgt_sr, config)
198
- logger.info(f"Model loaded: {character_name} / {info['feature_retrieval_library']} | ({model_version})")
199
- models.append((character_name, model_title, model_author, model_cover, model_version, create_vc_fn(model_name, tgt_sr, net_g, vc, if_f0, version, model_index)))
200
- category_count += 1
201
- categories.append([category_title, description, models])
202
- elif os.path.exists("weights"):
203
- models = []
204
- for w_root, w_dirs, _ in os.walk("weights"):
205
- model_count = 1
206
- for sub_dir in w_dirs:
207
- pth_files = glob.glob(f"weights/{sub_dir}/*.pth")
208
- index_files = glob.glob(f"weights/{sub_dir}/*.index")
209
- if pth_files == []:
210
- logger.debug(f"Model [{model_count}/{len(w_dirs)}]: No Model file detected, skipping...")
211
- continue
212
- cpt = torch.load(pth_files[0])
213
- tgt_sr = cpt["config"][-1]
214
- cpt["config"][-3] = cpt["weight"]["emb_g.weight"].shape[0] # n_spk
215
- if_f0 = cpt.get("f0", 1)
216
- version = cpt.get("version", "v1")
217
- if version == "v1":
218
- if if_f0 == 1:
219
- net_g = SynthesizerTrnMs256NSFsid(*cpt["config"], is_half=config.is_half)
220
- else:
221
- net_g = SynthesizerTrnMs256NSFsid_nono(*cpt["config"])
222
- model_version = "V1"
223
- elif version == "v2":
224
- if if_f0 == 1:
225
- net_g = SynthesizerTrnMs768NSFsid(*cpt["config"], is_half=config.is_half)
226
- else:
227
- net_g = SynthesizerTrnMs768NSFsid_nono(*cpt["config"])
228
- model_version = "V2"
229
- del net_g.enc_q
230
- logger.info(net_g.load_state_dict(cpt["weight"], strict=False))
231
- net_g.eval().to(config.device)
232
- if config.is_half:
233
- net_g = net_g.half()
234
- else:
235
- net_g = net_g.float()
236
- vc = VC(tgt_sr, config)
237
- if index_files == []:
238
- logger.warning("No Index file detected!")
239
- index_info = "None"
240
- model_index = ""
241
- else:
242
- index_info = index_files[0]
243
- model_index = index_files[0]
244
- logger.info(f"Model loaded [{model_count}/{len(w_dirs)}]: {index_files[0]} / {index_info} | ({model_version})")
245
- model_count += 1
246
- models.append((index_files[0][:-4], index_files[0][:-4], "", "", model_version, create_vc_fn(index_files[0], tgt_sr, net_g, vc, if_f0, version, model_index)))
247
- categories.append(["Models", "", models])
248
- else:
249
- categories = []
250
- return categories
251
-
252
- if __name__ == '__main__':
253
- categories = load_model()
254
- tts_voice_list = asyncio.new_event_loop().run_until_complete(edge_tts.list_voices())
255
- voices = [f"{v['ShortName']}-{v['Gender']}" for v in tts_voice_list]
256
- with gr.Blocks(theme='Hev832/emerald') as app:
257
- gr.Markdown(
258
- "<div align='center'>\n\n"+
259
- "# Multi Model RVC Inference\n\n"+
260
- "[![Repository](https://img.shields.io/badge/Github-Multi%20Model%20RVC%20Inference-blue?style=for-the-badge&logo=github)](https://github.com/ArkanDash/Multi-Model-RVC-Inference)\n\n"+
261
- "</div>"
262
- )
263
- if categories == []:
264
- gr.Markdown(
265
- "<div align='center'>\n\n"+
266
- "## No model found, please add the model into weights folder\n\n"+
267
- "</div>"
268
- )
269
- for (folder_title, description, models) in categories:
270
- with gr.TabItem(folder_title):
271
- if description:
272
- gr.Markdown(f"### <center> {description}")
273
- with gr.Tabs():
274
- if not models:
275
- gr.Markdown("# <center> No Model Loaded.")
276
- gr.Markdown("## <center> Please add the model or fix your model path.")
277
- continue
278
- for (name, title, author, cover, model_version, vc_fn) in models:
279
- with gr.TabItem(name):
280
- with gr.Row():
281
- gr.Markdown(
282
- '<div align="center">'
283
- f'<div>{title}</div>\n'+
284
- f'<div>RVC {model_version} Model</div>\n'+
285
- (f'<div>Model author: {author}</div>' if author else "")+
286
- (f'<img style="width:auto;height:300px;" src="file/{cover}">' if cover else "")+
287
- '</div>'
288
- )
289
- with gr.Row():
290
- if spaces is False:
291
- with gr.TabItem("Input"):
292
- with gr.Row():
293
- with gr.Column():
294
- vc_audio_mode = gr.Dropdown(label="Input voice", choices=audio_mode, allow_custom_value=False, value="Upload audio")
295
- # Input
296
- vc_input = gr.Textbox(label="Input audio path", visible=False)
297
- # Upload
298
- vc_upload = gr.Audio(label="Upload audio file", sources=["upload", "microphone"], visible=True, interactive=True)
299
- # Youtube
300
- vc_download_audio = gr.Dropdown(label="Provider", choices=["Youtube"], allow_custom_value=False, visible=False, value="Youtube", info="Select provider (Default: Youtube)")
301
- vc_link = gr.Textbox(label="Youtube URL", visible=False, info="Example: https://www.youtube.com/watch?v=Nc0sB1Bmf-A", placeholder="https://www.youtube.com/watch?v=...")
302
- vc_log_yt = gr.Textbox(label="Output Information", visible=False, interactive=False)
303
- vc_download_button = gr.Button("Download Audio", variant="primary", visible=False)
304
- vc_audio_preview = gr.Audio(label="Audio Preview", visible=False)
305
- # TTS
306
- tts_text = gr.Textbox(label="TTS text", info="Text to speech input", visible=False)
307
- tts_voice = gr.Dropdown(label="Edge-tts speaker", choices=voices, visible=False, allow_custom_value=False, value="en-US-AnaNeural-Female")
308
- with gr.Column():
309
- vc_split_model = gr.Dropdown(label="Splitter Model", choices=["hdemucs_mmi", "htdemucs", "htdemucs_ft", "mdx", "mdx_q", "mdx_extra_q"], allow_custom_value=False, visible=False, value="htdemucs", info="Select the splitter model (Default: htdemucs)")
310
- vc_split_log = gr.Textbox(label="Output Information", visible=False, interactive=False)
311
- vc_split = gr.Button("Split Audio", variant="primary", visible=False)
312
- vc_vocal_preview = gr.Audio(label="Vocal Preview", visible=False)
313
- vc_inst_preview = gr.Audio(label="Instrumental Preview", visible=False)
314
- with gr.TabItem("Convert"):
315
- with gr.Row():
316
- with gr.Column():
317
- vc_transform0 = gr.Number(label="Transpose", value=0, info='Type "12" to change from male to female voice. Type "-12" to change female to male voice')
318
- f0method0 = gr.Radio(
319
- label="Pitch extraction algorithm",
320
- info=f0method_info,
321
- choices=f0method_mode,
322
- value="pm",
323
- interactive=True
324
- )
325
- index_rate1 = gr.Slider(
326
- minimum=0,
327
- maximum=1,
328
- label="Retrieval feature ratio",
329
- info="(Default: 0.7)",
330
- value=0.7,
331
- interactive=True,
332
- )
333
- filter_radius0 = gr.Slider(
334
- minimum=0,
335
- maximum=7,
336
- label="Apply Median Filtering",
337
- info="The value represents the filter radius and can reduce breathiness.",
338
- value=3,
339
- step=1,
340
- interactive=True,
341
- )
342
- resample_sr0 = gr.Slider(
343
- minimum=0,
344
- maximum=48000,
345
- label="Resample the output audio",
346
- info="Resample the output audio in post-processing to the final sample rate. Set to 0 for no resampling",
347
- value=0,
348
- step=1,
349
- interactive=True,
350
- )
351
- rms_mix_rate0 = gr.Slider(
352
- minimum=0,
353
- maximum=1,
354
- label="Volume Envelope",
355
- info="Use the volume envelope of the input to replace or mix with the volume envelope of the output. The closer the ratio is to 1, the more the output envelope is used",
356
- value=1,
357
- interactive=True,
358
- )
359
- protect0 = gr.Slider(
360
- minimum=0,
361
- maximum=0.5,
362
- label="Voice Protection",
363
- info="Protect voiceless consonants and breath sounds to prevent artifacts such as tearing in electronic music. Set to 0.5 to disable. Decrease the value to increase protection, but it may reduce indexing accuracy",
364
- value=0.5,
365
- step=0.01,
366
- interactive=True,
367
- )
368
- with gr.Column():
369
- vc_log = gr.Textbox(label="Output Information", interactive=False)
370
- vc_output = gr.Audio(label="Output Audio", interactive=False)
371
- vc_convert = gr.Button("Convert", variant="primary")
372
- vc_vocal_volume = gr.Slider(
373
- minimum=0,
374
- maximum=10,
375
- label="Vocal volume",
376
- value=1,
377
- interactive=True,
378
- step=1,
379
- info="Adjust vocal volume (Default: 1}",
380
- visible=False
381
- )
382
- vc_inst_volume = gr.Slider(
383
- minimum=0,
384
- maximum=10,
385
- label="Instrument volume",
386
- value=1,
387
- interactive=True,
388
- step=1,
389
- info="Adjust instrument volume (Default: 1}",
390
- visible=False
391
- )
392
- vc_combined_output = gr.Audio(label="Output Combined Audio", visible=False)
393
- vc_combine = gr.Button("Combine",variant="primary", visible=False)
394
- else:
395
- with gr.Column():
396
- vc_audio_mode = gr.Dropdown(label="Input voice", choices=audio_mode, allow_custom_value=False, value="Upload audio")
397
- # Input
398
- vc_input = gr.Textbox(label="Input audio path", visible=False)
399
- # Upload
400
- vc_upload = gr.Audio(label="Upload audio file", sources=["upload", "microphone"], visible=True, interactive=True)
401
- # Youtube
402
- vc_download_audio = gr.Dropdown(label="Provider", choices=["Youtube"], allow_custom_value=False, visible=False, value="Youtube", info="Select provider (Default: Youtube)")
403
- vc_link = gr.Textbox(label="Youtube URL", visible=False, info="Example: https://www.youtube.com/watch?v=Nc0sB1Bmf-A", placeholder="https://www.youtube.com/watch?v=...")
404
- vc_log_yt = gr.Textbox(label="Output Information", visible=False, interactive=False)
405
- vc_download_button = gr.Button("Download Audio", variant="primary", visible=False)
406
- vc_audio_preview = gr.Audio(label="Audio Preview", visible=False)
407
- # Splitter
408
- vc_split_model = gr.Dropdown(label="Splitter Model", choices=["hdemucs_mmi", "htdemucs", "htdemucs_ft", "mdx", "mdx_q", "mdx_extra_q"], allow_custom_value=False, visible=False, value="htdemucs", info="Select the splitter model (Default: htdemucs)")
409
- vc_split_log = gr.Textbox(label="Output Information", visible=False, interactive=False)
410
- vc_split = gr.Button("Split Audio", variant="primary", visible=False)
411
- vc_vocal_preview = gr.Audio(label="Vocal Preview", visible=False)
412
- vc_inst_preview = gr.Audio(label="Instrumental Preview", visible=False)
413
- # TTS
414
- tts_text = gr.Textbox(label="TTS text", info="Text to speech input", visible=False)
415
- tts_voice = gr.Dropdown(label="Edge-tts speaker", choices=voices, visible=False, allow_custom_value=False, value="en-US-AnaNeural-Female")
416
- with gr.Column():
417
- vc_transform0 = gr.Number(label="Transpose", value=0, info='Type "12" to change from male to female voice. Type "-12" to change female to male voice')
418
- f0method0 = gr.Radio(
419
- label="Pitch extraction algorithm",
420
- info=f0method_info,
421
- choices=f0method_mode,
422
- value="pm",
423
- interactive=True
424
- )
425
- index_rate1 = gr.Slider(
426
- minimum=0,
427
- maximum=1,
428
- label="Retrieval feature ratio",
429
- info="(Default: 0.7)",
430
- value=0.7,
431
- interactive=True,
432
- )
433
- filter_radius0 = gr.Slider(
434
- minimum=0,
435
- maximum=7,
436
- label="Apply Median Filtering",
437
- info="The value represents the filter radius and can reduce breathiness.",
438
- value=3,
439
- step=1,
440
- interactive=True,
441
- )
442
- resample_sr0 = gr.Slider(
443
- minimum=0,
444
- maximum=48000,
445
- label="Resample the output audio",
446
- info="Resample the output audio in post-processing to the final sample rate. Set to 0 for no resampling",
447
- value=0,
448
- step=1,
449
- interactive=True,
450
- )
451
- rms_mix_rate0 = gr.Slider(
452
- minimum=0,
453
- maximum=1,
454
- label="Volume Envelope",
455
- info="Use the volume envelope of the input to replace or mix with the volume envelope of the output. The closer the ratio is to 1, the more the output envelope is used",
456
- value=1,
457
- interactive=True,
458
- )
459
- protect0 = gr.Slider(
460
- minimum=0,
461
- maximum=0.5,
462
- label="Voice Protection",
463
- info="Protect voiceless consonants and breath sounds to prevent artifacts such as tearing in electronic music. Set to 0.5 to disable. Decrease the value to increase protection, but it may reduce indexing accuracy",
464
- value=0.5,
465
- step=0.01,
466
- interactive=True,
467
- )
468
- with gr.Column():
469
- vc_log = gr.Textbox(label="Output Information", interactive=False)
470
- vc_output = gr.Audio(label="Output Audio", interactive=False)
471
- vc_convert = gr.Button("Convert", variant="primary")
472
- vc_vocal_volume = gr.Slider(
473
- minimum=0,
474
- maximum=10,
475
- label="Vocal volume",
476
- value=1,
477
- interactive=True,
478
- step=1,
479
- info="Adjust vocal volume (Default: 1}",
480
- visible=False
481
- )
482
- vc_inst_volume = gr.Slider(
483
- minimum=0,
484
- maximum=10,
485
- label="Instrument volume",
486
- value=1,
487
- interactive=True,
488
- step=1,
489
- info="Adjust instrument volume (Default: 1}",
490
- visible=False
491
- )
492
- vc_combined_output = gr.Audio(label="Output Combined Audio", visible=False)
493
- vc_combine = gr.Button("Combine",variant="primary", visible=False)
494
- vc_convert.click(
495
- fn=vc_fn,
496
- inputs=[
497
- vc_audio_mode,
498
- vc_input,
499
- vc_upload,
500
- tts_text,
501
- tts_voice,
502
- vc_transform0,
503
- f0method0,
504
- index_rate1,
505
- filter_radius0,
506
- resample_sr0,
507
- rms_mix_rate0,
508
- protect0,
509
- ],
510
- outputs=[vc_log ,vc_output]
511
- )
512
- vc_download_button.click(
513
- fn=download_audio,
514
- inputs=[vc_link, vc_download_audio],
515
- outputs=[vc_audio_preview, vc_log_yt]
516
- )
517
- vc_split.click(
518
- fn=cut_vocal_and_inst,
519
- inputs=[vc_split_model],
520
- outputs=[vc_split_log, vc_vocal_preview, vc_inst_preview, vc_input]
521
- )
522
- vc_combine.click(
523
- fn=combine_vocal_and_inst,
524
- inputs=[vc_output, vc_vocal_volume, vc_inst_volume, vc_split_model],
525
- outputs=[vc_combined_output]
526
- )
527
- vc_audio_mode.change(
528
- fn=change_audio_mode,
529
- inputs=[vc_audio_mode],
530
- outputs=[
531
- vc_input,
532
- vc_upload,
533
- vc_download_audio,
534
- vc_link,
535
- vc_log_yt,
536
- vc_download_button,
537
- vc_split_model,
538
- vc_split_log,
539
- vc_split,
540
- vc_audio_preview,
541
- vc_vocal_preview,
542
- vc_inst_preview,
543
- vc_vocal_volume,
544
- vc_inst_volume,
545
- vc_combined_output,
546
- vc_combine,
547
- tts_text,
548
- tts_voice
549
- ]
550
- )
551
- app.queue(
552
- max_size=20,
553
- api_open=config.api,
554
- ).launch(
555
- share=config.share,
556
- max_threads=1,
557
- allowed_paths=["weights"]
558
- )
 
1
  import os
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  os.system("aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt -d . -o hubert_base.pt")
4
+ os.system("aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/rmvpe.pt -d . -o rmvpe.pt")