diff --git a/deepspeech/frontend/augmentor/spec_augment.py b/deepspeech/frontend/augmentor/spec_augment.py index 7c23b628..a9bb043d 100644 --- a/deepspeech/frontend/augmentor/spec_augment.py +++ b/deepspeech/frontend/augmentor/spec_augment.py @@ -151,6 +151,9 @@ class SpecAugmentor(AugmentorBase): np.ndarray: time warped spectrogram (time, freq) """ window = max_time_warp = self.W + if window == 0: + return x + if mode == "PIL": t = x.shape[0] if t - window <= window: diff --git a/deepspeech/frontend/utility.py b/deepspeech/frontend/utility.py index 3d0683b0..72dfc98d 100644 --- a/deepspeech/frontend/utility.py +++ b/deepspeech/frontend/utility.py @@ -46,7 +46,7 @@ def load_dict(dict_path: Optional[Text], maskctc=False) -> Optional[List[Text]]: with open(dict_path, "r") as f: dictionary = f.readlines() - char_list = [entry.split(" ")[0] for entry in dictionary] + char_list = [entry.strip().split(" ")[0] for entry in dictionary] if BLANK not in char_list: char_list.insert(0, BLANK) if EOS not in char_list: