minor fixes for the repo

This commit is contained in:
zr_jin 2024-10-21 11:34:46 +08:00
parent e8b6b920c0
commit eb239cb634
2 changed files with 5 additions and 5 deletions

View File

@ -0,0 +1 @@
../../../librispeech/ASR/conformer_ctc/label_smoothing.py

View File

@ -2282,13 +2282,12 @@ def time_warp(
time_warp_factor: Optional[int] = 80,
supervision_segments: Optional[torch.Tensor] = None,
):
"""Apply time warping on a batch of features
"""
"""Apply time warping on a batch of features"""
if time_warp_factor is None or time_warp_factor < 1:
return features
assert len(features.shape) == 3, (
"SpecAugment only supports batches of single-channel feature matrices."
)
assert (
len(features.shape) == 3
), "SpecAugment only supports batches of single-channel feature matrices."
features = features.clone()
if supervision_segments is None:
# No supervisions - apply spec augment to full feature matrices.