Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -28,7 +28,7 @@ class TTS:
28
  last_chpt1 = './log/Taeyeon/Glow_TTS_337000.pt'
29
  check_point = torch.load(last_chpt1, map_location = device)
30
  self.flowgenerator.load_state_dict(check_point['generator' if model_variant != 'ํƒœ์—ฐ' else 'model'])
31
- self.flowgenerator.decoder.skip()
32
  self.flowgenerator.eval()
33
  if model_variant == '๊ฐ๊ธฐ๊ฑธ๋ฆฐ ์€์‹':
34
  last_chpt2 = './log/1038_eunsik_01/HiFI_GAN_00257000.pt'
@@ -49,7 +49,7 @@ class TTS:
49
  x_length = torch.tensor(x.shape[1]).unsqueeze(0).to(device)
50
 
51
  with torch.no_grad():
52
- (y_gen_tst, *_), *_, (attn_gen, *_) = self.flowgenerator(x, x_length, gen = True, noise_scale = noise_scale, length_scale = length_scale)
53
  y = self.voicegenerator(y_gen_tst)
54
  audio = y.squeeze() * 32768.0
55
  voice = audio.cpu().numpy().astype('int16')
 
28
  last_chpt1 = './log/Taeyeon/Glow_TTS_337000.pt'
29
  check_point = torch.load(last_chpt1, map_location = device)
30
  self.flowgenerator.load_state_dict(check_point['generator' if model_variant != 'ํƒœ์—ฐ' else 'model'])
31
+ self.flowgenerator.decoder.skip() if model_variant != 'ํƒœ์—ฐ' else None
32
  self.flowgenerator.eval()
33
  if model_variant == '๊ฐ๊ธฐ๊ฑธ๋ฆฐ ์€์‹':
34
  last_chpt2 = './log/1038_eunsik_01/HiFI_GAN_00257000.pt'
 
49
  x_length = torch.tensor(x.shape[1]).unsqueeze(0).to(device)
50
 
51
  with torch.no_grad():
52
+ (y_gen_tst, *_), *_, (attn_gen, *_) = self.flowgenerator(x, x_length, gen = True, noise_scale = noise_scale, length_scale = length_scale) if st.session_state.model_variant != "ํƒœ์—ฐ" else self.flowgenerator(x, x_length, inference = True, noise_scale = noise_scale, length_scale = length_scale)
53
  y = self.voicegenerator(y_gen_tst)
54
  audio = y.squeeze() * 32768.0
55
  voice = audio.cpu().numpy().astype('int16')