Update app.py
Browse files
app.py
CHANGED
|
@@ -56,9 +56,9 @@ def infer(text, character, language):
|
|
| 56 |
char_id = int(character.split(':')[0])
|
| 57 |
stn_tst = get_text(text, hps)
|
| 58 |
with torch.no_grad():
|
| 59 |
-
x_tst = stn_tst.
|
| 60 |
-
x_tst_lengths = torch.LongTensor([stn_tst.size(0)])
|
| 61 |
-
sid = torch.LongTensor([char_id])
|
| 62 |
audio = net_g.infer(x_tst, x_tst_lengths, sid=sid, noise_scale=.667, noise_scale_w=0.8, length_scale=1)[0][0,0].data.cpu().float().numpy()
|
| 63 |
return (text,(22050, audio))
|
| 64 |
|
|
|
|
| 56 |
char_id = int(character.split(':')[0])
|
| 57 |
stn_tst = get_text(text, hps)
|
| 58 |
with torch.no_grad():
|
| 59 |
+
x_tst = stn_tst.unsqueeze(0)
|
| 60 |
+
x_tst_lengths = torch.LongTensor([stn_tst.size(0)])
|
| 61 |
+
sid = torch.LongTensor([char_id])
|
| 62 |
audio = net_g.infer(x_tst, x_tst_lengths, sid=sid, noise_scale=.667, noise_scale_w=0.8, length_scale=1)[0][0,0].data.cpu().float().numpy()
|
| 63 |
return (text,(22050, audio))
|
| 64 |
|