Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -38,8 +38,8 @@ def create_tts_fn(model, hps, speaker_ids):
|
|
38 |
x_tst = stn_tst.unsqueeze(0).to(device)
|
39 |
x_tst_lengths = LongTensor([stn_tst.size(0)]).to(device)
|
40 |
|
41 |
-
if stn_tst.size(0) >=
|
42 |
-
return "文本太长了!", (hps.data.sampling_rate,
|
43 |
sid = LongTensor([speaker_id]).to(device)
|
44 |
audio = model.infer(x_tst, x_tst_lengths, sid=sid, noise_scale=.667, noise_scale_w=0.8,
|
45 |
length_scale=1.0 / speed)[0][0, 0].data.cpu().float().numpy()
|
|
|
38 |
x_tst = stn_tst.unsqueeze(0).to(device)
|
39 |
x_tst_lengths = LongTensor([stn_tst.size(0)]).to(device)
|
40 |
|
41 |
+
if stn_tst.size(0) >= 500:
|
42 |
+
return "文本太长了!", (hps.data.sampling_rate, np.zeros(1000))
|
43 |
sid = LongTensor([speaker_id]).to(device)
|
44 |
audio = model.infer(x_tst, x_tst_lengths, sid=sid, noise_scale=.667, noise_scale_w=0.8,
|
45 |
length_scale=1.0 / speed)[0][0, 0].data.cpu().float().numpy()
|