undo pad change
@@ -242,7 +242,8 @@ class Text2SpeechDataLayer(DataLayer):
)
pad_to = self.params.get('pad_to', 8)
if self.params.get("pad_EOS", True):
- num_pad = pad_to - (len(text_input) % pad_to)
+ # num_pad = pad_to - (len(text_input) % pad_to)
+ num_pad = pad_to - ((len(text_input) + 1) % pad_to) + 1
text_input = np.pad(
text_input, ((0, num_pad)),
"constant",
@@ -292,7 +293,8 @@ class Text2SpeechDataLayer(DataLayer):
[len(spectrogram)], dtype=self.params['dtype'].as_numpy_dtype()
)
if self.params.get("pad_EOS", True):
- num_pad = pad_to - (len(spectrogram) % pad_to)
+ # num_pad = pad_to - (len(spectrogram) % pad_to)
+ num_pad = pad_to - ((len(text_input) + 1) % pad_to) + 1
spectrogram = np.pad(
spectrogram, ((0, num_pad), (0, 0)), "constant", constant_values=0
)
@@ -327,7 +329,8 @@ class Text2SpeechDataLayer(DataLayer):
)
pad_to = self.params.get('pad_to', 8)
if self.params.get("pad_EOS", True):
- num_pad = pad_to - (len(text_input) % pad_to)
+ # num_pad = pad_to - (len(text_input) % pad_to)
+ num_pad = pad_to - ((len(text_input) + 1) % pad_to) + 1
text_input = np.pad(
text_input, ((0, num_pad)),
"constant",
