Spaces:
Runtime error
Runtime error
Update app.py
#30
by
marigold334
- opened
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 |
-
|
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')
|