From eb239cb6347b312663cb0ac26e5f656080d293f5 Mon Sep 17 00:00:00 2001 From: zr_jin Date: Mon, 21 Oct 2024 11:34:46 +0800 Subject: [PATCH] minor fixes for the repo --- egs/speech_llm/ASR_LLM/whisper_llm_zh/label_smoothing.py | 1 + icefall/utils.py | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) create mode 120000 egs/speech_llm/ASR_LLM/whisper_llm_zh/label_smoothing.py diff --git a/egs/speech_llm/ASR_LLM/whisper_llm_zh/label_smoothing.py b/egs/speech_llm/ASR_LLM/whisper_llm_zh/label_smoothing.py new file mode 120000 index 000000000..e9d239fff --- /dev/null +++ b/egs/speech_llm/ASR_LLM/whisper_llm_zh/label_smoothing.py @@ -0,0 +1 @@ +../../../librispeech/ASR/conformer_ctc/label_smoothing.py \ No newline at end of file diff --git a/icefall/utils.py b/icefall/utils.py index b0a42cefa..7b1301faf 100644 --- a/icefall/utils.py +++ b/icefall/utils.py @@ -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.