Skip to content

Commit

Permalink
Fix typos, remove unused packages, normalize comments (k2-fsa#1678)
Browse files Browse the repository at this point in the history
  • Loading branch information
yfyeung authored and Your Name committed Aug 9, 2024
1 parent 506ab95 commit 9033dd6
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion egs/librispeech/ASR/tdnn_lstm_ctc/asr_datamodule.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Piotr Żelasko
# Copyright 2021 Piotr Żelasko
# Copyright 2022 Xiaomi Corporation (Author: Mingshuang Luo)
#
# See ../../../../LICENSE for clarification regarding multiple authors
Expand Down
1 change: 0 additions & 1 deletion egs/librispeech/ASR/zipformer/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
from icefall.lexicon import Lexicon
from icefall.utils import (
AttributeDict,
make_pad_mask,
setup_logger,
store_transcripts,
str2bool,
Expand Down
1 change: 0 additions & 1 deletion egs/librispeech/ASR/zipformer/export-onnx-ctc.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
import onnx
import torch
import torch.nn as nn
from decoder import Decoder
from onnxruntime.quantization import QuantType, quantize_dynamic
from scaling_converter import convert_scaled_to_non_scaled
from train import add_model_arguments, get_model, get_params
Expand Down
3 changes: 0 additions & 3 deletions egs/librispeech/ASR/zipformer/jit_pretrained_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,12 @@

import argparse
import logging
import math
from typing import List, Optional

import k2
import kaldifeat
import torch
import torchaudio
from kaldifeat import FbankOptions, OnlineFbank, OnlineFeature
from torch.nn.utils.rnn import pad_sequence


def get_parser():
Expand Down
2 changes: 1 addition & 1 deletion egs/librispeech/ASR/zipformer/joiner.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def forward(
Output from the encoder. Its shape is (N, T, s_range, C).
decoder_out:
Output from the decoder. Its shape is (N, T, s_range, C).
project_input:
project_input:
If true, apply input projections encoder_proj and decoder_proj.
If this is false, it is the user's responsibility to do this
manually.
Expand Down
2 changes: 0 additions & 2 deletions egs/librispeech/ASR/zipformer/onnx_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@
import torch
from onnx_pretrained import OnnxModel

from icefall import is_module_available


def get_parser():
parser = argparse.ArgumentParser(
Expand Down
4 changes: 2 additions & 2 deletions egs/librispeech/ASR/zipformer/optim.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Xiaomi Corp. (authors: Daniel Povey)
# Copyright 2022 Xiaomi Corp. (authors: Daniel Povey)
#
# See ../LICENSE for clarification regarding multiple authors
#
Expand All @@ -22,7 +22,7 @@

import torch
from lhotse.utils import fix_random_seed
from torch import Tensor, nn
from torch import Tensor
from torch.optim import Optimizer


Expand Down
2 changes: 0 additions & 2 deletions egs/librispeech/ASR/zipformer/pretrained.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@
from torch.nn.utils.rnn import pad_sequence
from train import add_model_arguments, get_model, get_params

from icefall.utils import make_pad_mask


def get_parser():
parser = argparse.ArgumentParser(
Expand Down
5 changes: 3 additions & 2 deletions egs/librispeech/ASR/zipformer/scaling_converter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022-2023 Xiaomi Corp. (authors: Fangjun Kuang, Zengwei Yao)
# Copyright 2022-2023 Xiaomi Corp. (authors: Fangjun Kuang,
# Zengwei Yao)
#
# See ../../../../LICENSE for clarification regarding multiple authors
#
Expand All @@ -22,7 +23,7 @@
"""

import copy
from typing import List, Tuple
from typing import List

import torch
import torch.nn as nn
Expand Down
4 changes: 0 additions & 4 deletions egs/librispeech/ASR/zipformer/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,6 @@ def get_params() -> AttributeDict:
- subsampling_factor: The subsampling factor for the model.
- encoder_dim: Hidden dim for multi-head attention model.
- num_decoder_layers: Number of decoder layer of transformer decoder.
- warm_step: The warmup period that dictates the decay of the
scale on "simple" (un-pruned) loss.
"""
Expand Down

0 comments on commit 9033dd6

Please sign in to comment.