fix load vocab; zero W for not warptime

pull/784/head
Hui Zhang 3 years ago
parent fd3491ba1b
commit 8215bd0e79

@ -151,6 +151,9 @@ class SpecAugmentor(AugmentorBase):
np.ndarray: time warped spectrogram (time, freq) np.ndarray: time warped spectrogram (time, freq)
""" """
window = max_time_warp = self.W window = max_time_warp = self.W
if window == 0:
return x
if mode == "PIL": if mode == "PIL":
t = x.shape[0] t = x.shape[0]
if t - window <= window: if t - window <= window:

@ -46,7 +46,7 @@ def load_dict(dict_path: Optional[Text], maskctc=False) -> Optional[List[Text]]:
with open(dict_path, "r") as f: with open(dict_path, "r") as f:
dictionary = f.readlines() 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: if BLANK not in char_list:
char_list.insert(0, BLANK) char_list.insert(0, BLANK)
if EOS not in char_list: if EOS not in char_list:

Loading…
Cancel
Save