Skip to content

Commit

Permalink
minor fixes for the repo (#1775)
Browse files Browse the repository at this point in the history
* minor fixes for the repo

Co-authored-by: Fangjun Kuang <[email protected]>
  • Loading branch information
JinZr and csukuangfj authored Oct 21, 2024
1 parent e8b6b92 commit 88bacfb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion egs/librispeech/ASR/zipformer/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
import torch
import torch.nn as nn
from encoder_interface import EncoderInterface
from lhotse.dataset import SpecAugment
from scaling import ScaledLinear

from icefall.utils import add_sos, make_pad_mask, time_warp
from lhotse.dataset import SpecAugment


class AsrModel(nn.Module):
Expand Down
1 change: 1 addition & 0 deletions egs/speech_llm/ASR_LLM/whisper_llm_zh/label_smoothing.py
9 changes: 4 additions & 5 deletions icefall/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
), f"SpecAugment only supports batches of single-channel feature matrices. {features.shape}"
features = features.clone()
if supervision_segments is None:
# No supervisions - apply spec augment to full feature matrices.
Expand Down

0 comments on commit 88bacfb

Please sign in to comment.