Skip to content

Commit

Permalink
Rename train2.py to avoid confusion (#1386)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored Nov 17, 2023
1 parent 59c9438 commit 666d69b
Show file tree
Hide file tree
Showing 19 changed files with 23 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .github/scripts/run-multi-zh_hans-zipformer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ for method in modified_beam_search fast_beam_search; do
$repo/test_wavs/DEV_T0000000002.wav
done

rm -rf $repo

log "==== Test icefall-asr-multi-zh-hans-zipformer-ctc-2023-10-24 ===="
repo_url=https://huggingface.co/zrjin/icefall-asr-multi-zh-hans-zipformer-ctc-2023-10-24/

Expand Down Expand Up @@ -92,4 +94,4 @@ for method in modified_beam_search fast_beam_search; do
$repo/test_wavs/DEV_T0000000000.wav \
$repo/test_wavs/DEV_T0000000001.wav \
$repo/test_wavs/DEV_T0000000002.wav
done
done
5 changes: 2 additions & 3 deletions egs/aishell/ASR/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,9 @@ if [ $stage -le 8 ] && [ $stop_stage -ge 8 ]; then
fi

if [ ! -f $lang_char_dir/HLG.fst ]; then
lang_phone_dir=data/lang_phone
./local/prepare_lang_fst.py \
--lang-dir $lang_phone_dir \
--ngram-G ./data/lm/G_3_gram.fst.txt
--lang-dir $lang_char_dir \
--ngram-G ./data/lm/G_3_gram_char.fst.txt
fi
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,7 @@ def scan_pessimistic_batches_for_oom(


def main():
raise RuntimeError("Please don't use this file directly!")
parser = get_parser()
AsrDataModule.add_arguments(parser)
args = parser.parse_args()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
from decoder2 import Decoder
from onnxruntime.quantization import QuantType, quantize_dynamic
from scaling_converter import convert_scaled_to_non_scaled
from train2 import add_model_arguments, get_params, get_transducer_model
from do_not_use_it_directly import add_model_arguments, get_params, get_transducer_model
from zipformer import Zipformer

from icefall.checkpoint import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,7 @@ def scan_pessimistic_batches_for_oom(


def main():
raise RuntimeError("Please don't use this file directly!")
parser = get_parser()
AishellAsrDataModule.add_arguments(parser)
args = parser.parse_args()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ See https://k2-fsa.github.io/icefall/recipes/Streaming-ASR/librispeech/zipformer

[./emformer.py](./emformer.py) and [./train.py](./train.py)
are basically the same as
[./emformer2.py](./emformer2.py) and [./train2.py](./train2.py).
The only purpose of [./emformer2.py](./emformer2.py) and [./train2.py](./train2.py)
[./emformer2.py](./emformer2.py) and [./do_not_use_it_directly.py](./do_not_use_it_directly.py).
The only purpose of [./emformer2.py](./emformer2.py) and [./do_not_use_it_directly.py](./do_not_use_it_directly.py)
is for exporting to [sherpa-ncnn](https://github.com/k2-fsa/sherpa-ncnn).
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,7 @@ def scan_pessimistic_batches_for_oom(


def main():
raise RuntimeError("Please don't use this file directly!")
parser = get_parser()
CommonVoiceAsrDataModule.add_arguments(parser)
args = parser.parse_args()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,7 @@ def scan_pessimistic_batches_for_oom(


def main():
raise RuntimeError("Please don't use this file directly!")
parser = get_parser()
CSJAsrDataModule.add_arguments(parser)
Tokenizer.add_arguments(parser)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
import torch
from scaling_converter import convert_scaled_to_non_scaled
from tokenizer import Tokenizer
from train2 import add_model_arguments, get_params, get_transducer_model
from do_not_use_it_directly import add_model_arguments, get_params, get_transducer_model

from icefall.checkpoint import (
average_checkpoints,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,7 @@ def scan_pessimistic_batches_for_oom(


def main():
raise RuntimeError("Please don't use this file directly!")
parser = get_parser()
LibriSpeechAsrDataModule.add_arguments(parser)
args = parser.parse_args()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

import k2
import torch
from do_not_use_it_directly import add_model_arguments, get_params, get_transducer_model
from scaling_converter import convert_scaled_to_non_scaled
from train2 import add_model_arguments, get_params, get_transducer_model

from icefall.checkpoint import (
average_checkpoints,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
from decoder import Decoder
from emformer import Emformer
from scaling_converter import convert_scaled_to_non_scaled
from train2 import add_model_arguments, get_params, get_transducer_model
from do_not_use_it_directly import add_model_arguments, get_params, get_transducer_model

from icefall.checkpoint import (
average_checkpoints,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ See https://k2-fsa.github.io/icefall/recipes/Streaming-ASR/librispeech/zipformer

[./emformer.py](./emformer.py) and [./train.py](./train.py)
are basically the same as
[./emformer2.py](./emformer2.py) and [./train2.py](./train2.py).
The only purpose of [./emformer2.py](./emformer2.py) and [./train2.py](./train2.py)
[./emformer2.py](./emformer2.py) and [./do_not_use_it_directly.py](./do_not_use_it_directly.py).
The only purpose of [./emformer2.py](./emformer2.py) and [./do_not_use_it_directly.py](./do_not_use_it_directly.py)
is for exporting to [sherpa-ncnn](https://github.com/k2-fsa/sherpa-ncnn).

Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,7 @@ def scan_pessimistic_batches_for_oom(


def main():
raise RuntimeError("Please don't use this file directly!")
parser = get_parser()
LibriSpeechAsrDataModule.add_arguments(parser)
args = parser.parse_args()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@

import k2
import torch
from do_not_use_it_directly import add_model_arguments, get_params, get_transducer_model
from scaling_converter import convert_scaled_to_non_scaled
from train2 import add_model_arguments, get_params, get_transducer_model

from icefall.checkpoint import (
average_checkpoints,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@

import k2
import torch
from do_not_use_it_directly import add_model_arguments, get_params, get_transducer_model
from scaling_converter import convert_scaled_to_non_scaled
from train2 import add_model_arguments, get_params, get_transducer_model

from icefall.checkpoint import (
average_checkpoints,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@

import k2
import torch
from do_not_use_it_directly import add_model_arguments, get_params, get_transducer_model
from scaling_converter import convert_scaled_to_non_scaled
from train2 import add_model_arguments, get_params, get_transducer_model

from icefall.checkpoint import (
average_checkpoints,
Expand Down

This file was deleted.

0 comments on commit 666d69b

Please sign in to comment.