Spaces:
Build error
Build error
...
Browse files
app.py
CHANGED
|
@@ -73,7 +73,7 @@ character_dict = {
|
|
| 73 |
|
| 74 |
load_model(config_path, pth_path)
|
| 75 |
|
| 76 |
-
|
| 77 |
with app:
|
| 78 |
gr.HTML("""
|
| 79 |
<div
|
|
@@ -97,11 +97,10 @@ with app:
|
|
| 97 |
with gr.Row():
|
| 98 |
tts_input1 = gr.TextArea(
|
| 99 |
label="请输入文本(仅支持日语)", value="你好,世界!")
|
| 100 |
-
tts_input2 = gr.Dropdown([character_dict.keys], type="value",label="选择角色")
|
| 101 |
tts_submit = gr.Button("用文本合成", variant="primary")
|
| 102 |
tts_output2 = gr.Audio(label="Output")
|
| 103 |
# model_submit.click(load_model, [config_path, pth_path])
|
| 104 |
-
tts_submit.click(infer, [
|
| 105 |
gr.HTML("""
|
| 106 |
<div style="text-align:center">
|
| 107 |
仅供学习交流,不可用于商业或非法用途
|
|
@@ -109,33 +108,4 @@ with app:
|
|
| 109 |
使用本项目模型直接或间接生成的音频,必须声明由AI技术或VITS技术合成
|
| 110 |
</div>
|
| 111 |
""")
|
| 112 |
-
app.launch()
|
| 113 |
-
|
| 114 |
-
gr.HTML("""
|
| 115 |
-
<div
|
| 116 |
-
style="width: 100%;padding-top:116px;background-image: url('https://huggingface.co/spaces/tumuyan/vits-miki/resolve/main/bg.webp');;background-size:cover">
|
| 117 |
-
<div>
|
| 118 |
-
<div>
|
| 119 |
-
<h4 class="h-sign" style="font-size: 12px;">
|
| 120 |
-
这是一个使用<a href="https://github.com/thesupersonic16/DALTools" target="_blank">thesupersonic16/DALTools</a>提供的解包音频作为数据集,
|
| 121 |
-
使用<a href="https://github.com/jaywalnut310/vits" target="_blank">VITS</a>技术训练的语音合成demo。
|
| 122 |
-
</h4>
|
| 123 |
-
</div>
|
| 124 |
-
</div>
|
| 125 |
-
</div>
|
| 126 |
-
""")
|
| 127 |
-
|
| 128 |
-
demo = gr.Interface(
|
| 129 |
-
fn=infer,
|
| 130 |
-
inputs=[gr.Dropdown([character_dict.keys], type="value",label="选择角色"), gr.TextArea(label="请输入文本(仅支持日语)", value="你好,世界!")],
|
| 131 |
-
outputs=[gr.Audio(label="Output")],
|
| 132 |
-
)
|
| 133 |
-
demo.launch()
|
| 134 |
-
|
| 135 |
-
gr.HTML("""
|
| 136 |
-
<div style="text-align:center">
|
| 137 |
-
仅供学习交流,不可用于商业或非法用途
|
| 138 |
-
<br/>
|
| 139 |
-
使用本项目模型直接或间接生成的音频,必须声明由AI技术或VITS技术合成
|
| 140 |
-
</div>
|
| 141 |
-
""")
|
|
|
|
| 73 |
|
| 74 |
load_model(config_path, pth_path)
|
| 75 |
|
| 76 |
+
app = gr.Blocks()
|
| 77 |
with app:
|
| 78 |
gr.HTML("""
|
| 79 |
<div
|
|
|
|
| 97 |
with gr.Row():
|
| 98 |
tts_input1 = gr.TextArea(
|
| 99 |
label="请输入文本(仅支持日语)", value="你好,世界!")
|
|
|
|
| 100 |
tts_submit = gr.Button("用文本合成", variant="primary")
|
| 101 |
tts_output2 = gr.Audio(label="Output")
|
| 102 |
# model_submit.click(load_model, [config_path, pth_path])
|
| 103 |
+
tts_submit.click(infer, ["2", tts_input1], [tts_output2])
|
| 104 |
gr.HTML("""
|
| 105 |
<div style="text-align:center">
|
| 106 |
仅供学习交流,不可用于商业或非法用途
|
|
|
|
| 108 |
使用本项目模型直接或间接生成的音频,必须声明由AI技术或VITS技术合成
|
| 109 |
</div>
|
| 110 |
""")
|
| 111 |
+
app.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|