Mahiruoshi commited on
Commit
4dcbdea
1 Parent(s): fceceaa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -6
app.py CHANGED
@@ -226,7 +226,7 @@ def create_tts_fn(net_g,hps,speaker_id):
226
  pass
227
 
228
  file_path = "subtitles.srt"
229
- return file_path,(hps.data.sampling_rate, np.concatenate(audio_fin)),file_path,htm
230
  return tts_fn
231
 
232
  if __name__ == '__main__':
@@ -262,6 +262,14 @@ if __name__ == '__main__':
262
  models.append(content)
263
 
264
  with gr.Blocks() as app:
 
 
 
 
 
 
 
 
265
  with gr.Tabs():
266
  for i in schools:
267
  with gr.TabItem(i):
@@ -282,20 +290,20 @@ if __name__ == '__main__':
282
  with gr.Column(scale=0.15, min_width=0):
283
  btnVC = gr.Button("Send")
284
  output1 = gr.Audio(label="采样率22050")
285
- with gr.Accordion(label="Setting", open=False):
286
  input2 = gr.Dropdown(label="Language", choices=lan, value="自动", interactive=True)
287
- input3 = gr.Checkbox(value=False, label="长句切割(小说合成)")
288
  input4 = gr.Slider(minimum=0, maximum=1.0, label="更改噪声比例(noise scale),以控制情感", value=0.467)
289
  input5 = gr.Slider(minimum=0, maximum=1.0, label="更改噪声偏差(noise scale w),以控制音素长短", value=0.7)
290
  input6 = gr.Slider(minimum=0.1, maximum=10, label="duration", value=1)
291
- with gr.Accordion(label="Advanced Setting", open=False):
292
  audio_input3 = gr.Dropdown(label="重复次数", choices=list(range(101)), value='0', interactive=True)
 
 
293
  api_input1 = gr.Checkbox(value=False, label="接入chatgpt")
294
  api_input2 = gr.TextArea(label="api-key",lines=1,value = '见 https://openai.com/blog/openai-api')
295
- output2 = gr.outputs.File(label="字幕文件:subtitles.srt")
296
  audio_input1 = gr.Checkbox(value=False, label="修改音频路径(live2d)")
297
  audio_input2 = gr.TextArea(label="音频路径",lines=1,value = '#参考 D:/app_develop/live2d_whole/2010002/sounds/temp.wav')
298
 
299
  btnVC.click(tts_fn, inputs=[api_input1,api_input2,audio_input1,audio_input2,audio_input3,input1,input2,input3,input4,input5,input6], outputs=[output1,output2,output_UI])
300
 
301
- app.launch()
 
226
  pass
227
 
228
  file_path = "subtitles.srt"
229
+ return (hps.data.sampling_rate, np.concatenate(audio_fin)),file_path,htm
230
  return tts_fn
231
 
232
  if __name__ == '__main__':
 
262
  models.append(content)
263
 
264
  with gr.Blocks() as app:
265
+ gr.Markdown(
266
+ "# <center>Seisho-Nijigasaki vits-models with chatghpt support\n"
267
+ "# <center>少歌&&虹团vits\n"
268
+ "## <center> Please do not generate content that could infringe upon the rights or cause harm to individuals or organizations.\n"
269
+ "## <center> 请不要生成会对个人以及企划造成侵害的内容\n"
270
+ "## <center>自带chatgpt支持,长句分割支持,srt字幕生成,可修改音频生成路径至live2d语音路径"
271
+ "## <center> 数据集版权归官方所有,严禁商用及恶意使用"
272
+ )
273
  with gr.Tabs():
274
  for i in schools:
275
  with gr.TabItem(i):
 
290
  with gr.Column(scale=0.15, min_width=0):
291
  btnVC = gr.Button("Send")
292
  output1 = gr.Audio(label="采样率22050")
293
+ with gr.Accordion(label="Setting(TTS)", open=False):
294
  input2 = gr.Dropdown(label="Language", choices=lan, value="自动", interactive=True)
 
295
  input4 = gr.Slider(minimum=0, maximum=1.0, label="更改噪声比例(noise scale),以控制情感", value=0.467)
296
  input5 = gr.Slider(minimum=0, maximum=1.0, label="更改噪声偏差(noise scale w),以控制音素长短", value=0.7)
297
  input6 = gr.Slider(minimum=0.1, maximum=10, label="duration", value=1)
298
+ with gr.Accordion(label="Advanced Setting()", open=False):
299
  audio_input3 = gr.Dropdown(label="重复次数", choices=list(range(101)), value='0', interactive=True)
300
+ input3 = gr.Checkbox(value=False, label="长句切割(小说合成)")
301
+ output2 = gr.outputs.File(label="字幕文件:subtitles.srt")
302
  api_input1 = gr.Checkbox(value=False, label="接入chatgpt")
303
  api_input2 = gr.TextArea(label="api-key",lines=1,value = '见 https://openai.com/blog/openai-api')
 
304
  audio_input1 = gr.Checkbox(value=False, label="修改音频路径(live2d)")
305
  audio_input2 = gr.TextArea(label="音频路径",lines=1,value = '#参考 D:/app_develop/live2d_whole/2010002/sounds/temp.wav')
306
 
307
  btnVC.click(tts_fn, inputs=[api_input1,api_input2,audio_input1,audio_input2,audio_input3,input1,input2,input3,input4,input5,input6], outputs=[output1,output2,output_UI])
308
 
309
+ app.launch()