Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,7 @@ net_g = SynthesizerTrn(
|
|
43 |
len(symbols),
|
44 |
hps.data.filter_length // 2 + 1,
|
45 |
hps.train.segment_size // hps.data.hop_length,
|
46 |
-
**hps.model)
|
47 |
_ = net_g.eval()
|
48 |
|
49 |
_ = utils.load_checkpoint("G_265000.pth", net_g, None)
|
@@ -51,9 +51,9 @@ _ = utils.load_checkpoint("G_265000.pth", net_g, None)
|
|
51 |
def syn(content):
|
52 |
stn_tst = get_text(content, hps)
|
53 |
with torch.no_grad():
|
54 |
-
x_tst = stn_tst.
|
55 |
-
x_tst_lengths = torch.LongTensor([stn_tst.size(0)])
|
56 |
-
audio = net_g.infer(x_tst, x_tst_lengths, noise_scale=.667, noise_scale_w=0.8, length_scale=1)[0][0,0].data.
|
57 |
return (hps.data.sampling_rate,audio)
|
58 |
#ipd.display(ipd.Audio(audio, rate=hps.data.sampling_rate))
|
59 |
|
|
|
43 |
len(symbols),
|
44 |
hps.data.filter_length // 2 + 1,
|
45 |
hps.train.segment_size // hps.data.hop_length,
|
46 |
+
**hps.model)
|
47 |
_ = net_g.eval()
|
48 |
|
49 |
_ = utils.load_checkpoint("G_265000.pth", net_g, None)
|
|
|
51 |
def syn(content):
|
52 |
stn_tst = get_text(content, hps)
|
53 |
with torch.no_grad():
|
54 |
+
x_tst = stn_tst.unsqueeze(0)
|
55 |
+
x_tst_lengths = torch.LongTensor([stn_tst.size(0)])
|
56 |
+
audio = net_g.infer(x_tst, x_tst_lengths, noise_scale=.667, noise_scale_w=0.8, length_scale=1)[0][0,0].data.float().numpy()
|
57 |
return (hps.data.sampling_rate,audio)
|
58 |
#ipd.display(ipd.Audio(audio, rate=hps.data.sampling_rate))
|
59 |
|