Mahiruoshi commited on
Commit
14f1e54
·
1 Parent(s): 17bde20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -183,7 +183,7 @@ def infer(
183
  del x_tst, tones, lang_ids, bert, x_tst_lengths, speakers, ja_bert, en_bert, emo
184
  if torch.cuda.is_available():
185
  torch.cuda.empty_cache()
186
- return (hps.data.sampling_rate,audio)
187
 
188
  def is_japanese(string):
189
  for ch in string:
@@ -203,7 +203,7 @@ if __name__ == "__main__":
203
  emotional_model = EmotionModel.from_pretrained(emotional_model_name).to(device)
204
  hps = utils.get_hparams_from_file('Data/BanGDream/configs/config.json')
205
  net_g = get_net_g(
206
- model_path='Data/BangDream/models/G_49000.pth', version="2.1", device=device, hps=hps
207
  )
208
  speaker_ids = hps.data.spk2id
209
  speakers = list(speaker_ids.keys())
 
183
  del x_tst, tones, lang_ids, bert, x_tst_lengths, speakers, ja_bert, en_bert, emo
184
  if torch.cuda.is_available():
185
  torch.cuda.empty_cache()
186
+ return (hps.data.sampling_rate,gr.processing_utils.convert_to_16_bit_wav(audio))
187
 
188
  def is_japanese(string):
189
  for ch in string:
 
203
  emotional_model = EmotionModel.from_pretrained(emotional_model_name).to(device)
204
  hps = utils.get_hparams_from_file('Data/BanGDream/configs/config.json')
205
  net_g = get_net_g(
206
+ model_path='Data/BanGDream/models/G_63000.pth', version="2.1", device=device, hps=hps
207
  )
208
  speaker_ids = hps.data.spk2id
209
  speakers = list(speaker_ids.keys())