Commit
·
1fb8364
1
Parent(s):
f222b7d
Update app.py
Browse files
app.py
CHANGED
@@ -22,8 +22,9 @@ class VitsGradio:
|
|
22 |
def __init__(self):
|
23 |
self.dev = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
24 |
self.lan = ["中文","日文","自动","手动"]
|
25 |
-
self.idols = ["
|
26 |
self.modelPaths = []
|
|
|
27 |
for root,dirs,files in os.walk("checkpoints"):
|
28 |
for dir in dirs:
|
29 |
self.modelPaths.append(dir)
|
@@ -31,9 +32,7 @@ class VitsGradio:
|
|
31 |
gr.Markdown(
|
32 |
"## <center> Lovelive虹团中日双语VITS\n"
|
33 |
"### <center> 请不要生成会对个人以及企划造成侵害的内容\n"
|
34 |
-
"<div align='center'
|
35 |
-
'<div align="center"><a>参数说明:由于爱抖露们过于有感情,合成日语时建议将噪声比例调节至0.2-0.3区间,噪声偏差对应着每个字之间的间隔,对普通话影响较大,duration代表整体语速</div>'
|
36 |
-
'<div align="center"><a>合成前请先选择模型,否则第一次合成不一定成功。长段落/小说合成建议colab或本地运行</div>')
|
37 |
with gr.Tab("TTS合成"):
|
38 |
with gr.Row():
|
39 |
with gr.Column():
|
@@ -44,17 +43,11 @@ class VitsGradio:
|
|
44 |
input3 = gr.Dropdown(label="Speaker", choices=self.idols, value="歩夢", interactive=True)
|
45 |
btnVC = gr.Button("Submit")
|
46 |
with gr.Column():
|
47 |
-
input4 = gr.Slider(minimum=0, maximum=1.0, label="更改噪声比例(noise scale),以控制情感", value=0.
|
48 |
-
input5 = gr.Slider(minimum=0, maximum=1.0, label="更改噪声偏差(noise scale w),以控制音素长短", value=0.
|
49 |
input6 = gr.Slider(minimum=0.1, maximum=10, label="duration", value=1)
|
50 |
output1 = gr.Audio(label="采样率22050")
|
51 |
btnVC.click(self.infer, inputs=[input1, input2, input3, input4, input5, input6], outputs=[output1])
|
52 |
-
with gr.Tab("选择模型"):
|
53 |
-
with gr.Column():
|
54 |
-
modelstrs = gr.Dropdown(label = "模型", choices = self.modelPaths, value = self.modelPaths[0], type = "value")
|
55 |
-
btnMod = gr.Button("载入模型")
|
56 |
-
statusa = gr.TextArea()
|
57 |
-
btnMod.click(self.loadCk, inputs=[modelstrs], outputs = [statusa])
|
58 |
with gr.Tab("Voice Conversion"):
|
59 |
gr.Markdown("""
|
60 |
录制或上传声音,并选择要转换的音色。
|
|
|
22 |
def __init__(self):
|
23 |
self.dev = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
24 |
self.lan = ["中文","日文","自动","手动"]
|
25 |
+
self.idols = ["高咲侑","歩夢","かすみ","しずく","果林","愛","彼方","せつ菜","璃奈","栞子","エマ","ランジュ","ミア","華恋","まひる","なな","クロディーヌ","ひかり",'純那',"香子","真矢","双葉","ミチル","メイファン","やちよ","晶","いちえ","ゆゆ子","塁","珠緒","あるる","ララフィン","美空","静羽","あるる"]
|
26 |
self.modelPaths = []
|
27 |
+
self.loadCk('tmp')
|
28 |
for root,dirs,files in os.walk("checkpoints"):
|
29 |
for dir in dirs:
|
30 |
self.modelPaths.append(dir)
|
|
|
32 |
gr.Markdown(
|
33 |
"## <center> Lovelive虹团中日双语VITS\n"
|
34 |
"### <center> 请不要生成会对个人以及企划造成侵害的内容\n"
|
35 |
+
"<div align='center'>(由于神秘bug,这个仓库几乎用不了,已经转移至 https://huggingface.co/spaces/Mahiruoshi/lovelive-ShojoKageki-vits )</div>")
|
|
|
|
|
36 |
with gr.Tab("TTS合成"):
|
37 |
with gr.Row():
|
38 |
with gr.Column():
|
|
|
43 |
input3 = gr.Dropdown(label="Speaker", choices=self.idols, value="歩夢", interactive=True)
|
44 |
btnVC = gr.Button("Submit")
|
45 |
with gr.Column():
|
46 |
+
input4 = gr.Slider(minimum=0, maximum=1.0, label="更改噪声比例(noise scale),以控制情感", value=0.6)
|
47 |
+
input5 = gr.Slider(minimum=0, maximum=1.0, label="更改噪声偏差(noise scale w),以控制音素长短", value=0.668)
|
48 |
input6 = gr.Slider(minimum=0.1, maximum=10, label="duration", value=1)
|
49 |
output1 = gr.Audio(label="采样率22050")
|
50 |
btnVC.click(self.infer, inputs=[input1, input2, input3, input4, input5, input6], outputs=[output1])
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
with gr.Tab("Voice Conversion"):
|
52 |
gr.Markdown("""
|
53 |
录制或上传声音,并选择要转换的音色。
|