Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -394,56 +394,63 @@ if __name__ == "__main__":
|
|
394 |
with gr.Blocks() as app:
|
395 |
with gr.Row():
|
396 |
with gr.Column():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
text = gr.TextArea(
|
398 |
label="输入文本内容",
|
399 |
placeholder="""
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
另外,所有的语言选项都可以用'|'分割长段实现分句生成。
|
407 |
""",
|
408 |
)
|
409 |
-
trans = gr.Button("中翻日", variant="primary")
|
410 |
-
slicer = gr.Button("快速切分", variant="primary")
|
411 |
speaker = gr.Dropdown(
|
412 |
-
choices=speakers, value=speakers[0], label="
|
413 |
)
|
414 |
_ = gr.Markdown(
|
415 |
-
value="提示模式(Prompt mode
|
416 |
)
|
417 |
prompt_mode = gr.Radio(
|
418 |
-
["
|
419 |
label="Prompt Mode",
|
420 |
value="Text prompt",
|
421 |
)
|
422 |
text_prompt = gr.Textbox(
|
423 |
-
label="
|
424 |
-
placeholder="
|
425 |
-
value="
|
426 |
visible=True,
|
427 |
)
|
428 |
audio_prompt = gr.Audio(
|
429 |
-
label="
|
430 |
)
|
431 |
sdp_ratio = gr.Slider(
|
432 |
-
minimum=0, maximum=1, value=0.2, step=0.
|
433 |
)
|
434 |
noise_scale = gr.Slider(
|
435 |
-
minimum=0.1, maximum=2, value=0.
|
436 |
)
|
437 |
noise_scale_w = gr.Slider(
|
438 |
-
minimum=0.1, maximum=2, value=0.
|
439 |
)
|
440 |
length_scale = gr.Slider(
|
441 |
-
minimum=0.1, maximum=2, value=1.0, step=0.
|
442 |
)
|
443 |
language = gr.Dropdown(
|
444 |
choices=languages, value=languages[0], label="Language"
|
445 |
)
|
446 |
-
btn = gr.Button("
|
447 |
with gr.Column():
|
448 |
with gr.Row():
|
449 |
with gr.Column():
|
|
|
394 |
with gr.Blocks() as app:
|
395 |
with gr.Row():
|
396 |
with gr.Column():
|
397 |
+
gr.Markdown(value="""
|
398 |
+
【AI孙笑川】在线语音合成(Bert-Vits2 2.0中日英)\n
|
399 |
+
作者:Xz乔希 https://space.bilibili.com/5859321\n
|
400 |
+
声音归属:孙笑川 https://space.bilibili.com/402574397\n
|
401 |
+
【AI合集】https://www.modelscope.cn/studios/xzjosh/Bert-VITS2\n
|
402 |
+
Bert-VITS2项目:https://github.com/Stardust-minus/Bert-VITS2\n
|
403 |
+
使用本模型请严格遵守法律法规!\n
|
404 |
+
发布二创作品请标注本项目作者及链接、作品使用Bert-VITS2 AI生成!\n
|
405 |
+
【提示】手机端容易误触调节,请刷新恢复默认!每次生成的结果都不一样,效果不好请尝试多次生成与调节,选择最佳结果!\n
|
406 |
+
""")
|
407 |
text = gr.TextArea(
|
408 |
label="输入文本内容",
|
409 |
placeholder="""
|
410 |
+
推荐不同语言分开推理,因为无法连贯且可能影响最终效果!
|
411 |
+
如果选择语言为\'auto\',有概率无法识别。
|
412 |
+
如果选择语言为\'mix\',必须按照格式输入,否则报错:
|
413 |
+
格式举例(zh是中文,jp是日语,en是英语;不区分大小写):
|
414 |
+
[说话人]<zh>你好 <jp>こんにちは <en>Hello
|
415 |
+
另外,所有的语言选项都可以用'|'分割长段实现分句生成。
|
|
|
416 |
""",
|
417 |
)
|
|
|
|
|
418 |
speaker = gr.Dropdown(
|
419 |
+
choices=speakers, value=speakers[0], label="说话人"
|
420 |
)
|
421 |
_ = gr.Markdown(
|
422 |
+
value="提示模式(Prompt mode):可选文字提示或音频提示,用于生成文字或音频指定风格的声音,\n"
|
423 |
)
|
424 |
prompt_mode = gr.Radio(
|
425 |
+
["文字提示", "音频提示"],
|
426 |
label="Prompt Mode",
|
427 |
value="Text prompt",
|
428 |
)
|
429 |
text_prompt = gr.Textbox(
|
430 |
+
label="文字提示",
|
431 |
+
placeholder="使用首字母大写的英文单词来描述生成风格。如:Happy",
|
432 |
+
value="",
|
433 |
visible=True,
|
434 |
)
|
435 |
audio_prompt = gr.Audio(
|
436 |
+
label="音频提示", type="filepath", visible=False
|
437 |
)
|
438 |
sdp_ratio = gr.Slider(
|
439 |
+
minimum=0, maximum=1, value=0.2, step=0.01, label="SDP Ratio"
|
440 |
)
|
441 |
noise_scale = gr.Slider(
|
442 |
+
minimum=0.1, maximum=2, value=0.5, step=0.01, label="Noise"
|
443 |
)
|
444 |
noise_scale_w = gr.Slider(
|
445 |
+
minimum=0.1, maximum=2, value=0.9, step=0.01, label="Noise_W"
|
446 |
)
|
447 |
length_scale = gr.Slider(
|
448 |
+
minimum=0.1, maximum=2, value=1.0, step=0.01, label="Length"
|
449 |
)
|
450 |
language = gr.Dropdown(
|
451 |
choices=languages, value=languages[0], label="Language"
|
452 |
)
|
453 |
+
btn = gr.Button("点击生成", variant="primary")
|
454 |
with gr.Column():
|
455 |
with gr.Row():
|
456 |
with gr.Column():
|