From a757b203bc619146d4ea6b8af5135656ee11966a Mon Sep 17 00:00:00 2001 From: erogol Date: Thu, 26 Nov 2020 15:05:03 +0100 Subject: [PATCH] fix longer phoneme seqs --- TTS/tts/datasets/TTSDataset.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TTS/tts/datasets/TTSDataset.py b/TTS/tts/datasets/TTSDataset.py index 7b671397..9b8cbdd3 100644 --- a/TTS/tts/datasets/TTSDataset.py +++ b/TTS/tts/datasets/TTSDataset.py @@ -138,6 +138,12 @@ class MyDataset(Dataset): if "attn_file" in locals(): attn = np.load(attn_file) + if len(text) > self.max_seq_len: + # return a different sample if the phonemized + # text is longer than the threshold + # TODO: find a better fix + return self.load_data(100) + sample = { 'text': text, 'wav': wav,