kevinwang676 commited on
Commit
a8ccc9e
·
verified ·
1 Parent(s): f7e440a

Create app_vc_colab.py

Browse files
Files changed (1) hide show
  1. GPT_SoVITS/app_vc_colab.py +495 -0
GPT_SoVITS/app_vc_colab.py ADDED
@@ -0,0 +1,495 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ """
4
+ 受 GPT-SoVITS 启发
5
+ """
6
+
7
+ import os
8
+ import os.path as osp
9
+ import re
10
+ import logging
11
+ from time import time as ttime
12
+ from warnings import warn
13
+
14
+ logging.getLogger("markdown_it").setLevel(logging.ERROR)
15
+ logging.getLogger("urllib3").setLevel(logging.ERROR)
16
+ logging.getLogger("httpcore").setLevel(logging.ERROR)
17
+ logging.getLogger("httpx").setLevel(logging.ERROR)
18
+ logging.getLogger("asyncio").setLevel(logging.ERROR)
19
+ logging.getLogger("charset_normalizer").setLevel(logging.ERROR)
20
+ logging.getLogger("torchaudio._extension").setLevel(logging.ERROR)
21
+
22
+ import torch
23
+ from torch import nn
24
+ import torch.nn.functional as F
25
+ import librosa
26
+ import numpy as np
27
+ import LangSegment
28
+ import gradio as gr
29
+ from transformers import AutoModelForMaskedLM, AutoTokenizer
30
+ from feature_extractor import cnhubert
31
+
32
+ from module.models import SynthesizerTrn
33
+ from module.mel_processing import spectrogram_torch
34
+ from AR.models.t2s_lightning_module import Text2SemanticLightningModule
35
+ from text import cleaned_text_to_sequence
36
+ from text.cleaner import clean_text
37
+ from my_utils import load_audio
38
+ from tools.i18n.i18n import I18nAuto
39
+
40
+
41
+ def get_pretrain_model_path(env_name, log_file, def_path):
42
+ """ 获取预训练模型路径
43
+ env_name: 从环境变量获取,第一优先级
44
+ log_file: 记录在文本文件内,第二优先级
45
+ def_path: 传参,第三优先级
46
+ """
47
+ if osp.isfile(log_file):
48
+ def_path = open(log_file, 'r', encoding="utf-8").read()
49
+ pretrain_path = os.environ.get(env_name, def_path)
50
+ return pretrain_path
51
+
52
+
53
+ device = "cuda" if torch.cuda.is_available() else "cpu"
54
+
55
+ gpt_path = get_pretrain_model_path('gpt_path', "./gweight.txt",
56
+ "GPT_SoVITS/pretrained_models/s1bert25hz-2kh-longer-epoch=68e-step=50232.ckpt")
57
+
58
+ sovits_path = get_pretrain_model_path('sovits_path', "./sweight.txt",
59
+ "GPT_SoVITS/pretrained_models/s2G488k.pth")
60
+
61
+ cnhubert_base_path = get_pretrain_model_path("cnhubert_base_path", '', "GPT_SoVITS/pretrained_models/chinese-hubert-base")
62
+
63
+ bert_path = get_pretrain_model_path("bert_path", '', "GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large")
64
+
65
+ vc_webui_port = int(os.environ.get("vc_webui_port", 9888)) # specify gradio port
66
+ print(f'port: {vc_webui_port}')
67
+
68
+ is_share = eval(os.environ.get("is_share", "False"))
69
+
70
+ if "_CUDA_VISIBLE_DEVICES" in os.environ:
71
+ os.environ["CUDA_VISIBLE_DEVICES"] = os.environ["_CUDA_VISIBLE_DEVICES"]
72
+
73
+ # is_half = eval(os.environ.get("is_half", "True")) and not torch.backends.mps.is_available()
74
+ is_half = False
75
+
76
+ os.environ['PYTORCH_ENABLE_MPS_FALLBACK'] = '1' # 确保直接启动推理UI时也能够设置。
77
+
78
+ cnhubert.cnhubert_base_path = cnhubert_base_path
79
+
80
+ i18n = I18nAuto()
81
+
82
+ tokenizer = AutoTokenizer.from_pretrained(bert_path)
83
+ bert_model = AutoModelForMaskedLM.from_pretrained(bert_path)
84
+ if is_half:
85
+ bert_model = bert_model.half().to(device)
86
+ else:
87
+ bert_model = bert_model.to(device)
88
+
89
+
90
+ def get_bert_feature(text, word2ph):
91
+ with torch.no_grad():
92
+ inputs = tokenizer(text, return_tensors="pt")
93
+ for i in inputs:
94
+ inputs[i] = inputs[i].to(device)
95
+ res = bert_model(**inputs, output_hidden_states=True)
96
+ res = torch.cat(res["hidden_states"][-3:-2], -1)[0].cpu()[1:-1]
97
+ assert len(word2ph) == len(text)
98
+ phone_level_feature = []
99
+ for i in range(len(word2ph)):
100
+ repeat_feature = res[i].repeat(word2ph[i], 1)
101
+ phone_level_feature.append(repeat_feature)
102
+ phone_level_feature = torch.cat(phone_level_feature, dim=0)
103
+ return phone_level_feature.T
104
+
105
+
106
+ class DictToAttrRecursive(dict):
107
+ def __init__(self, input_dict):
108
+ super().__init__(input_dict)
109
+ for key, value in input_dict.items():
110
+ if isinstance(value, dict):
111
+ value = DictToAttrRecursive(value)
112
+ self[key] = value
113
+ setattr(self, key, value)
114
+
115
+ def __getattr__(self, item):
116
+ try:
117
+ return self[item]
118
+ except KeyError:
119
+ raise AttributeError(f"Attribute {item} not found")
120
+
121
+ def __setattr__(self, key, value):
122
+ if isinstance(value, dict):
123
+ value = DictToAttrRecursive(value)
124
+ super(DictToAttrRecursive, self).__setitem__(key, value)
125
+ super().__setattr__(key, value)
126
+
127
+ def __delattr__(self, item):
128
+ try:
129
+ del self[item]
130
+ except KeyError:
131
+ raise AttributeError(f"Attribute {item} not found")
132
+
133
+
134
+ ssl_model = cnhubert.get_model()
135
+ if is_half:
136
+ ssl_model = ssl_model.half().to(device)
137
+ else:
138
+ ssl_model = ssl_model.to(device)
139
+
140
+
141
+ def change_sovits_weights(sovits_path):
142
+ global vq_model, hps
143
+ dict_s2 = torch.load(sovits_path)
144
+ hps = dict_s2["config"]
145
+ hps = DictToAttrRecursive(hps)
146
+ hps.model.semantic_frame_rate = "25hz"
147
+ vq_model = SynthesizerTrn(
148
+ hps.data.filter_length // 2 + 1,
149
+ hps.train.segment_size // hps.data.hop_length,
150
+ n_speakers=hps.data.n_speakers,
151
+ **hps.model
152
+ )
153
+ if ("pretrained" not in sovits_path):
154
+ del vq_model.enc_q
155
+ if is_half == True:
156
+ vq_model = vq_model.half().to(device)
157
+ else:
158
+ vq_model = vq_model.to(device)
159
+ vq_model.eval()
160
+ print(vq_model.load_state_dict(dict_s2["weight"], strict=False))
161
+ with open("./sweight.txt", "w", encoding="utf-8") as f:
162
+ f.write(sovits_path)
163
+
164
+
165
+ change_sovits_weights(sovits_path)
166
+
167
+
168
+ def change_gpt_weights(gpt_path):
169
+ global hz, max_sec, t2s_model, config
170
+ hz = 50
171
+ dict_s1 = torch.load(gpt_path)
172
+ config = dict_s1["config"]
173
+ max_sec = config["data"]["max_sec"]
174
+ t2s_model = Text2SemanticLightningModule(config, "****", is_train=False)
175
+ t2s_model.load_state_dict(dict_s1["weight"])
176
+ if is_half == True:
177
+ t2s_model = t2s_model.half()
178
+ t2s_model = t2s_model.to(device)
179
+ t2s_model.eval()
180
+ total = sum([param.nelement() for param in t2s_model.parameters()])
181
+ print("Number of parameter: %.2fM" % (total / 1e6))
182
+ with open("./gweight.txt", "w", encoding="utf-8") as f: f.write(gpt_path)
183
+
184
+
185
+ change_gpt_weights(gpt_path)
186
+
187
+
188
+ def get_spepc(hps, filename):
189
+ audio = load_audio(filename, int(hps.data.sampling_rate))
190
+ audio = torch.FloatTensor(audio)
191
+ audio_norm = audio
192
+ audio_norm = audio_norm.unsqueeze(0)
193
+ spec = spectrogram_torch(
194
+ audio_norm,
195
+ hps.data.filter_length,
196
+ hps.data.sampling_rate,
197
+ hps.data.hop_length,
198
+ hps.data.win_length,
199
+ center=False,
200
+ )
201
+ return spec
202
+
203
+
204
+ dict_language = {
205
+ i18n("中文"): "all_zh",#全部按中文识别
206
+ i18n("英文"): "en",#全部按英文识别#######不变
207
+ i18n("日文"): "all_ja",#全部按日文识别
208
+ i18n("中英混合"): "zh",#按中英混合识别####不变
209
+ i18n("日英混合"): "ja",#按日英混合识别####不变
210
+ i18n("多语种混合"): "auto",#多语种启动切分识别语种
211
+ }
212
+
213
+
214
+ # def clean_text_inf(text, language):
215
+ # phones, word2ph, norm_text = clean_text(text, language)
216
+ # phones = cleaned_text_to_sequence(phones)
217
+ # return phones, word2ph, norm_text
218
+
219
+
220
+ def clean_text_inf(text, language):
221
+ """
222
+ text: 字符串
223
+ language: 所属语言
224
+
225
+ return:
226
+ phones: 音素 id 序列
227
+ word2ph: 每个字转音素后,对应的个数,对于中文,就是声韵母,因此是全是 2 的 list
228
+ norm_text: 归一化后文本
229
+ """
230
+ formattext = ""
231
+ language = language.replace("all_","")
232
+ for tmp in LangSegment.getTexts(text):
233
+ if language == "ja":
234
+ if tmp["lang"] == language or tmp["lang"] == "zh":
235
+ formattext += tmp["text"] + " "
236
+ continue
237
+ if tmp["lang"] == language:
238
+ formattext += tmp["text"] + " "
239
+ while " " in formattext:
240
+ formattext = formattext.replace(" ", " ")
241
+ phones, word2ph, norm_text = clean_text(formattext, language)
242
+ # print(f'音素: {phones}')
243
+ phones = cleaned_text_to_sequence(phones) # 统一了中、英、日等
244
+ # print(f'音素 id: {phones}')
245
+ return phones, word2ph, norm_text
246
+
247
+
248
+ dtype=torch.float16 if is_half == True else torch.float32
249
+ def get_bert_inf(phones, word2ph, norm_text, language):
250
+ language=language.replace("all_","")
251
+ if language == "zh":
252
+ bert = get_bert_feature(norm_text, word2ph).to(device)#.to(dtype)
253
+ else:
254
+ bert = torch.zeros(
255
+ (1024, len(phones)),
256
+ dtype=torch.float16 if is_half == True else torch.float32,
257
+ ).to(device)
258
+
259
+ return bert
260
+
261
+
262
+ splits = {",", "。", "?", "!", ",", ".", "?", "!", "~", ":", ":", "—", "…", }
263
+
264
+ def split(todo_text):
265
+ todo_text = todo_text.replace("……", "。").replace("——", ",")
266
+ if todo_text[-1] not in splits:
267
+ todo_text += "。"
268
+ i_split_head = i_split_tail = 0
269
+ len_text = len(todo_text)
270
+ todo_texts = []
271
+ while 1:
272
+ if i_split_head >= len_text:
273
+ break # 结尾一定有标点,所以直接跳出即可,最后一段在上次已加入
274
+ if todo_text[i_split_head] in splits:
275
+ i_split_head += 1
276
+ todo_texts.append(todo_text[i_split_tail:i_split_head])
277
+ i_split_tail = i_split_head
278
+ else:
279
+ i_split_head += 1
280
+ return todo_texts
281
+
282
+ def custom_sort_key(s):
283
+ # 使用正则表达式提取字符串中的数字部分和非数字部分
284
+ parts = re.split('(\d+)', s)
285
+ # 将数字部分转换为整数,非数字部分保持不变
286
+ parts = [int(part) if part.isdigit() else part for part in parts]
287
+ return parts
288
+
289
+
290
+ def change_choices():
291
+ SoVITS_names, GPT_names = get_weights_names()
292
+ return {"choices": sorted(SoVITS_names, key=custom_sort_key), "__type__": "update"}, {"choices": sorted(GPT_names, key=custom_sort_key), "__type__": "update"}
293
+
294
+
295
+ pretrained_sovits_name = "GPT_SoVITS/pretrained_models/s2G488k.pth"
296
+ pretrained_gpt_name = "GPT_SoVITS/pretrained_models/s1bert25hz-2kh-longer-epoch=68e-step=50232.ckpt"
297
+ SoVITS_weight_root = "SoVITS_weights"
298
+ GPT_weight_root = "GPT_weights"
299
+ os.makedirs(SoVITS_weight_root, exist_ok=True)
300
+ os.makedirs(GPT_weight_root, exist_ok=True)
301
+
302
+
303
+ def get_weights_names():
304
+ SoVITS_names = [pretrained_sovits_name]
305
+ for name in os.listdir(SoVITS_weight_root):
306
+ if name.endswith(".pth"): SoVITS_names.append("%s/%s" % (SoVITS_weight_root, name))
307
+ GPT_names = [pretrained_gpt_name]
308
+ for name in os.listdir(GPT_weight_root):
309
+ if name.endswith(".ckpt"): GPT_names.append("%s/%s" % (GPT_weight_root, name))
310
+ return SoVITS_names, GPT_names
311
+
312
+
313
+ SoVITS_names, GPT_names = get_weights_names()
314
+
315
+
316
+ @torch.no_grad()
317
+ def get_code_from_ssl(ssl):
318
+ ssl = vq_model.ssl_proj(ssl)
319
+ quantized, codes, commit_loss, quantized_list = vq_model.quantizer(ssl)
320
+ # print(codes.shape, codes.dtype) # [n_q, B, T]
321
+ return codes.transpose(0, 1) # [B, n_q, T]
322
+
323
+
324
+ @torch.no_grad()
325
+ def get_code_from_wav(wav_path):
326
+ wav16k, sr = librosa.load(wav_path, sr=16000)
327
+ if (wav16k.shape[0] > 160000 or wav16k.shape[0] < 48000):
328
+ # raise OSError(i18n("参考音频在3~10秒范围外,请更换!"))
329
+ warn(i18n("参考音频在3~10秒范围外,请更换!"))
330
+ wav16k = torch.from_numpy(wav16k)
331
+ if is_half == True:
332
+ wav16k = wav16k.half().to(device)
333
+ else:
334
+ wav16k = wav16k.to(device)
335
+ ssl_content = ssl_model.model(wav16k.unsqueeze(0))[
336
+ "last_hidden_state"
337
+ ].transpose(
338
+ 1, 2
339
+ ) # .float()
340
+ codes = get_code_from_ssl(ssl_content) # [B, n_q, T]
341
+
342
+ prompt_semantic = codes[0, 0]
343
+ return prompt_semantic
344
+
345
+
346
+ def splite_en_inf(sentence, language):
347
+ pattern = re.compile(r'[a-zA-Z ]+')
348
+ textlist = []
349
+ langlist = []
350
+ pos = 0
351
+ for match in pattern.finditer(sentence):
352
+ start, end = match.span()
353
+ if start > pos:
354
+ textlist.append(sentence[pos:start])
355
+ langlist.append(language)
356
+ textlist.append(sentence[start:end])
357
+ langlist.append("en")
358
+ pos = end
359
+ if pos < len(sentence):
360
+ textlist.append(sentence[pos:])
361
+ langlist.append(language)
362
+ # Merge punctuation into previous word
363
+ for i in range(len(textlist)-1, 0, -1):
364
+ if re.match(r'^[\W_]+$', textlist[i]):
365
+ textlist[i-1] += textlist[i]
366
+ del textlist[i]
367
+ del langlist[i]
368
+ # Merge consecutive words with the same language tag
369
+ i = 0
370
+ while i < len(langlist) - 1:
371
+ if langlist[i] == langlist[i+1]:
372
+ textlist[i] += textlist[i+1]
373
+ del textlist[i+1]
374
+ del langlist[i+1]
375
+ else:
376
+ i += 1
377
+
378
+ return textlist, langlist
379
+
380
+
381
+ def nonen_clean_text_inf(text, language):
382
+ if(language!="auto"):
383
+ textlist, langlist = splite_en_inf(text, language)
384
+ else:
385
+ textlist=[]
386
+ langlist=[]
387
+ for tmp in LangSegment.getTexts(text):
388
+ langlist.append(tmp["lang"])
389
+ textlist.append(tmp["text"])
390
+ phones_list = []
391
+ word2ph_list = []
392
+ norm_text_list = []
393
+ for i in range(len(textlist)):
394
+ lang = langlist[i]
395
+ phones, word2ph, norm_text = clean_text_inf(textlist[i], lang)
396
+ phones_list.append(phones)
397
+ if lang == "zh":
398
+ word2ph_list.append(word2ph)
399
+ norm_text_list.append(norm_text)
400
+ print(word2ph_list)
401
+ phones = sum(phones_list, [])
402
+ word2ph = sum(word2ph_list, [])
403
+ norm_text = ' '.join(norm_text_list)
404
+
405
+ return phones, word2ph, norm_text
406
+
407
+
408
+ def get_cleaned_text_final(text,language):
409
+ if language in {"en","all_zh","all_ja"}:
410
+ phones, word2ph, norm_text = clean_text_inf(text, language)
411
+ elif language in {"zh", "ja","auto"}:
412
+ phones, word2ph, norm_text = nonen_clean_text_inf(text, language)
413
+ return phones, word2ph, norm_text
414
+
415
+
416
+ @torch.no_grad()
417
+ def vc_main(wav_path, text, language, prompt_wav, noise_scale=0.5):
418
+ """ Voice Conversion
419
+ wav_path: 待变声的源音频
420
+ text: 对应文本
421
+ language: 对应语言
422
+ prompt_wav: 目标人声
423
+ """
424
+ language = dict_language[language]
425
+
426
+ phones, word2ph, norm_text = get_cleaned_text_final(text, language)
427
+
428
+ spec = get_spepc(hps, prompt_wav)
429
+ spec = spec.to(device)
430
+ codes = get_code_from_wav(wav_path)[None, None].to(device) # 必须是 3D, [n_q, B, T]
431
+ ge = vq_model.ref_enc(spec) # [B, D, T/1]
432
+ quantized = vq_model.quantizer.decode(codes) # [B, D, T]
433
+ if hps.model.semantic_frame_rate == "25hz":
434
+ quantized = F.interpolate(
435
+ quantized, size=int(quantized.shape[-1] * 2), mode="nearest"
436
+ )
437
+ lengths_tensor = torch.LongTensor([quantized.shape[-1]]).to(device)
438
+ phones_tensor = torch.LongTensor(phones)[None].to(device)
439
+ phones_lengths_tensor = torch.LongTensor([len(phones)]).to(device)
440
+
441
+ _, m_p, logs_p, y_mask = vq_model.enc_p(
442
+ quantized, lengths_tensor, phones_tensor, phones_lengths_tensor, ge
443
+ )
444
+ z_p = m_p + torch.randn_like(m_p) * torch.exp(logs_p) * noise_scale
445
+ z = vq_model.flow(z_p, y_mask, g=ge, reverse=True)
446
+ o = vq_model.dec((z * y_mask)[:, :, :], g=ge) # [B, D=1, T], torch.float32 (-1, 1)
447
+ audio = o.detach().cpu().numpy()[0, 0]
448
+ max_audio = np.abs(audio).max() # 简单防止16bit爆音
449
+ if max_audio > 1:
450
+ audio /= max_audio
451
+ yield hps.data.sampling_rate, (audio * 32768).astype(np.int16)
452
+
453
+
454
+ with gr.Blocks(title="GPT-SoVITS-VC WebUI") as app:
455
+
456
+ gr.Markdown(
457
+ value=i18n("本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>LICENSE</b>.")
458
+ )
459
+
460
+ with gr.Group():
461
+ gr.Markdown(value=i18n("模型切换"))
462
+
463
+ with gr.Row():
464
+ GPT_dropdown = gr.Dropdown(label=i18n("GPT模型列表"), choices=sorted(GPT_names, key=custom_sort_key), value=gpt_path, interactive=True)
465
+ SoVITS_dropdown = gr.Dropdown(label=i18n("SoVITS模型列表"), choices=sorted(SoVITS_names, key=custom_sort_key), value=sovits_path, interactive=True)
466
+ refresh_button = gr.Button(i18n("刷新模型路径"), variant="primary")
467
+ refresh_button.click(fn=change_choices, inputs=[], outputs=[SoVITS_dropdown, GPT_dropdown])
468
+ SoVITS_dropdown.change(change_sovits_weights, [SoVITS_dropdown], [])
469
+ GPT_dropdown.change(change_gpt_weights, [GPT_dropdown], [])
470
+
471
+ gr.Markdown(value=i18n("* 请上传目标音色音频,要求说话人单一,声音干净"))
472
+ with gr.Row():
473
+ inp_ref = gr.Audio(label=i18n("请上传 3~10 秒内参考音频,超过会报警!"), type="filepath")
474
+
475
+ gr.Markdown(value=i18n("* 请填写需要变声/转换的源音频,以及对应文本"))
476
+ with gr.Row():
477
+ src_audio = gr.Audio(label=i18n('源音频'), type='filepath')
478
+ text = gr.Textbox(label=i18n("源音频对应文本"), value="")
479
+ text_language = gr.Dropdown(
480
+ label=i18n("文本语种"), choices=[i18n("中文"), i18n("英文"), i18n("日文"), i18n("中英混合"), i18n("日英混合"), i18n("多语种混合")], value=i18n("中文")
481
+ )
482
+
483
+ inference_button = gr.Button(i18n("合成语音"), variant="primary")
484
+ output = gr.Audio(label=i18n("变声后"))
485
+
486
+ inference_button.click(
487
+ vc_main,
488
+ [src_audio, text, text_language, inp_ref],
489
+ [output],
490
+ )
491
+
492
+ app.queue().launch(
493
+ share=True,
494
+ show_error=True,
495
+ )