Mahiruoshi commited on
Commit
d82925d
1 Parent(s): 354c347

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -233,25 +233,24 @@ if __name__ == '__main__':
233
  hps = utils.get_hparams_from_file('checkpoints/tmp/config.json')
234
  dev = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
235
  models = []
236
- schools = ["Nijigasaki High School","Seisho-Nijigasaki","Seisho Music Academy","Rinmeikan Girls School","Frontier School of Arts","Siegfeld Institute of Music"]
237
  lan = ["中文","日文","自动","手动"]
238
  with open("checkpoints/info.json", "r", encoding="utf-8") as f:
239
  models_info = json.load(f)
 
 
 
 
 
 
 
 
240
  for i in models_info:
241
  school = models_info[i]
242
  speakers = school["speakers"]
243
- checkpoint = school["checkpoint"]
244
  phone_dict = {
245
  symbol: i for i, symbol in enumerate(symbols)
246
  }
247
- net_g = SynthesizerTrn(
248
- len(symbols),
249
- hps.data.filter_length // 2 + 1,
250
- hps.train.segment_size // hps.data.hop_length,
251
- n_speakers=hps.data.n_speakers,
252
- **hps.model).to(dev)
253
- _ = net_g.eval()
254
- _ = utils.load_checkpoint(checkpoint, net_g)
255
  content = []
256
  for j in speakers:
257
  sid = int(speakers[j]['sid'])
@@ -267,7 +266,7 @@ if __name__ == '__main__':
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语音路径\n"
271
  "## <center> 数据集版权归官方所有,严禁商用及恶意使用"
272
  )
273
  with gr.Tabs():
 
233
  hps = utils.get_hparams_from_file('checkpoints/tmp/config.json')
234
  dev = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
235
  models = []
236
+ schools = ["Nijigasaki High School","Seisho Music Academy","Rinmeikan Girls School","Frontier School of Arts","Siegfeld Institute of Music"]
237
  lan = ["中文","日文","自动","手动"]
238
  with open("checkpoints/info.json", "r", encoding="utf-8") as f:
239
  models_info = json.load(f)
240
+ net_g = SynthesizerTrn(
241
+ len(symbols),
242
+ hps.data.filter_length // 2 + 1,
243
+ hps.train.segment_size // hps.data.hop_length,
244
+ n_speakers=hps.data.n_speakers,
245
+ **hps.model).to(dev)
246
+ _ = net_g.eval()
247
+ _ = utils.load_checkpoint("checkpoints/tmp/model.pth" , net_g)
248
  for i in models_info:
249
  school = models_info[i]
250
  speakers = school["speakers"]
 
251
  phone_dict = {
252
  symbol: i for i, symbol in enumerate(symbols)
253
  }
 
 
 
 
 
 
 
 
254
  content = []
255
  for j in speakers:
256
  sid = int(speakers[j]['sid'])
 
266
  "# <center>少歌&&虹团vits\n"
267
  "## <center> Please do not generate content that could infringe upon the rights or cause harm to individuals or organizations.\n"
268
  "## <center> 请不要生成会对个人以及企划造成侵害的内容\n"
269
+ "## <center>,自带chatgpt支持,长句分割支持,srt字幕生成,可修改音频生成路径至live2d语音路径\n"
270
  "## <center> 数据集版权归官方所有,严禁商用及恶意使用"
271
  )
272
  with gr.Tabs():