fixed the evaluation sampling rate
Browse files
README.md
CHANGED
@@ -88,13 +88,13 @@ model.to("cuda")
|
|
88 |
|
89 |
chars_to_ignore_regex = '[\,\?\.\!\-\;\:\"\“\%\‘\'\”\�]'
|
90 |
|
91 |
-
resampler = torchaudio.transforms.Resample(48_000, 16_000)
|
92 |
|
93 |
# Preprocessing the datasets.
|
94 |
# We need to read the aduio files as arrays
|
95 |
def speech_file_to_array_fn(batch):
|
96 |
batch["sentence"] = re.sub(chars_to_ignore_regex, '', batch["sentence"]).lower()
|
97 |
speech_array, sampling_rate = torchaudio.load(batch["path"])
|
|
|
98 |
batch["speech"] = resampler(speech_array).squeeze().numpy()
|
99 |
return batch
|
100 |
|
|
|
88 |
|
89 |
chars_to_ignore_regex = '[\,\?\.\!\-\;\:\"\“\%\‘\'\”\�]'
|
90 |
|
|
|
91 |
|
92 |
# Preprocessing the datasets.
|
93 |
# We need to read the aduio files as arrays
|
94 |
def speech_file_to_array_fn(batch):
|
95 |
batch["sentence"] = re.sub(chars_to_ignore_regex, '', batch["sentence"]).lower()
|
96 |
speech_array, sampling_rate = torchaudio.load(batch["path"])
|
97 |
+
resampler = torchaudio.transforms.Resample(sampling_rate, 16_000)
|
98 |
batch["speech"] = resampler(speech_array).squeeze().numpy()
|
99 |
return batch
|
100 |
|