Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -394,63 +394,56 @@ if __name__ == "__main__":
|
|
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 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
|
|
415 |
另外,所有的语言选项都可以用'|'分割长段实现分句生成。
|
416 |
""",
|
417 |
)
|
|
|
|
|
418 |
speaker = gr.Dropdown(
|
419 |
-
choices=speakers, value=speakers[0], label="
|
420 |
)
|
421 |
_ = gr.Markdown(
|
422 |
-
value="提示模式(Prompt mode
|
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="
|
432 |
-
value="",
|
433 |
visible=True,
|
434 |
)
|
435 |
audio_prompt = gr.Audio(
|
436 |
-
label="
|
437 |
)
|
438 |
sdp_ratio = gr.Slider(
|
439 |
-
minimum=0, maximum=1, value=0.2, step=0.
|
440 |
)
|
441 |
noise_scale = gr.Slider(
|
442 |
-
minimum=0.1, maximum=2, value=0.
|
443 |
)
|
444 |
noise_scale_w = gr.Slider(
|
445 |
-
minimum=0.1, maximum=2, value=0.
|
446 |
)
|
447 |
length_scale = gr.Slider(
|
448 |
-
minimum=0.1, maximum=2, value=1.0, step=0.
|
449 |
)
|
450 |
language = gr.Dropdown(
|
451 |
choices=languages, value=languages[0], label="Language"
|
452 |
)
|
453 |
-
btn = gr.Button("
|
454 |
with gr.Column():
|
455 |
with gr.Row():
|
456 |
with gr.Column():
|
|
|
394 |
with gr.Blocks() as app:
|
395 |
with gr.Row():
|
396 |
with gr.Column():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
text = gr.TextArea(
|
398 |
label="输入文本内容",
|
399 |
placeholder="""
|
400 |
+
如果你选择语言为\'mix\',必须按照格式输入,否则报错:
|
401 |
+
格式举例(zh是中文,jp是日语,不区分大小写;说话人举例:gongzi):
|
402 |
+
[说话人1]<zh>你好,こんにちは! <jp>こんにちは,世界。
|
403 |
+
[说话人2]<zh>你好吗?<jp>元気ですか?
|
404 |
+
[说话人3]<zh>谢谢。<jp>どういたしまして。
|
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="Speaker"
|
413 |
)
|
414 |
_ = gr.Markdown(
|
415 |
+
value="提示模式(Prompt mode):可选文字提示或音频提示,用于生成文字或音频指定风格的声音。\n"
|
416 |
)
|
417 |
prompt_mode = gr.Radio(
|
418 |
+
["Text prompt", "Audio prompt"],
|
419 |
label="Prompt Mode",
|
420 |
value="Text prompt",
|
421 |
)
|
422 |
text_prompt = gr.Textbox(
|
423 |
+
label="Text prompt",
|
424 |
+
placeholder="用文字描述生成风格。如:Happy",
|
425 |
+
value="Happy",
|
426 |
visible=True,
|
427 |
)
|
428 |
audio_prompt = gr.Audio(
|
429 |
+
label="Audio prompt", type="filepath", visible=False
|
430 |
)
|
431 |
sdp_ratio = gr.Slider(
|
432 |
+
minimum=0, maximum=1, value=0.2, step=0.1, label="SDP Ratio"
|
433 |
)
|
434 |
noise_scale = gr.Slider(
|
435 |
+
minimum=0.1, maximum=2, value=0.6, step=0.1, label="Noise"
|
436 |
)
|
437 |
noise_scale_w = gr.Slider(
|
438 |
+
minimum=0.1, maximum=2, value=0.8, step=0.1, label="Noise_W"
|
439 |
)
|
440 |
length_scale = gr.Slider(
|
441 |
+
minimum=0.1, maximum=2, value=1.0, step=0.1, label="Length"
|
442 |
)
|
443 |
language = gr.Dropdown(
|
444 |
choices=languages, value=languages[0], label="Language"
|
445 |
)
|
446 |
+
btn = gr.Button("生成音频!", variant="primary")
|
447 |
with gr.Column():
|
448 |
with gr.Row():
|
449 |
with gr.Column():
|