mirror of
https://github.com/wassname/TTS.git
synced 2026-10-28 12:41:20 +08:00
fix #382
This commit is contained in:
1 parent
31935cd39e
commit
7bda48c81e
1 file changed
+5
-1
@@ -181,8 +181,12 @@ class SpeedySpeech(nn.Module):
|
||||
x_lengths: [B]
|
||||
g: [B, C]
|
||||
"""
|
||||
# input sequence should be greated than the max convolution size
|
||||
inference_padding = 5
|
||||
if x.shape[1] < 13:
|
||||
inference_padding += 13 - x.shape[1]
|
||||
# pad input to prevent dropping the last word
|
||||
x = torch.nn.functional.pad(x, pad=(0, 5), mode='constant', value=0)
|
||||
x = torch.nn.functional.pad(x, pad=(0, inference_padding), mode='constant', value=0)
|
||||
o_en, o_en_dp, x_mask, g = self._forward_encoder(x, x_lengths, g)
|
||||
# duration predictor pass
|
||||
o_dr_log = self.duration_predictor(o_en_dp.detach(), x_mask)
|
||||
|
||||
Reference in new issue
Block a user