update collate function, data loader not does not convert nested list into numpy array.

This commit is contained in:
chenfeiyu 2021-04-13 16:17:46 +08:00 committed by iclementine
parent c6965e2c5a
commit e54f23befd
1 changed files with 2 additions and 1 deletions

View File

@ -86,9 +86,10 @@ class LJSpeechCollector(object):
for i, _ in sorted(
zip(mel_lens, text_lens), key=lambda x: x[1], reverse=True)
]
mel_lens = np.array(mel_lens, dtype=np.int64)
text_lens = sorted(text_lens, reverse=True)
text_lens = np.array(sorted(text_lens, reverse=True), dtype=np.int64)
# Pad sequence with largest len of the batch
texts = batch_text_id(texts, pad_id=self.padding_idx)