diff --git a/codes/data/audio/nv_tacotron_dataset.py b/codes/data/audio/nv_tacotron_dataset.py index c6d509c6..3b2902d8 100644 --- a/codes/data/audio/nv_tacotron_dataset.py +++ b/codes/data/audio/nv_tacotron_dataset.py @@ -84,7 +84,11 @@ class TextWavLoader(torch.utils.data.Dataset): return text_norm def __getitem__(self, index): - tseq, wav, text, path = self.get_wav_text_pair(self.audiopaths_and_text[index]) + try: + tseq, wav, text, path = self.get_wav_text_pair(self.audiopaths_and_text[index]) + except: + print(f"error loadding {self.audiopaths_and_text[index][0]") + return self[index+1] if wav is None or \ (self.max_wav_len is not None and wav.shape[-1] > self.max_wav_len) or \ (self.max_text_len is not None and tseq.shape[0] > self.max_text_len):