Merge branch 'master' into zipformer_hat
This commit is contained in:
commit
4e3bf9a791
2
.flake8
2
.flake8
@ -15,7 +15,7 @@ per-file-ignores =
|
|||||||
egs/librispeech/ASR/zipformer_mmi/*.py: E501, E203
|
egs/librispeech/ASR/zipformer_mmi/*.py: E501, E203
|
||||||
egs/librispeech/ASR/zipformer/*.py: E501, E203
|
egs/librispeech/ASR/zipformer/*.py: E501, E203
|
||||||
egs/librispeech/ASR/RESULTS.md: E999,
|
egs/librispeech/ASR/RESULTS.md: E999,
|
||||||
|
egs/ljspeech/TTS/vits/*.py: E501, E203
|
||||||
# invalid escape sequence (cause by tex formular), W605
|
# invalid escape sequence (cause by tex formular), W605
|
||||||
icefall/utils.py: E501, W605
|
icefall/utils.py: E501, W605
|
||||||
|
|
||||||
|
|||||||
1
.github/scripts/.gitignore
vendored
Normal file
1
.github/scripts/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
piper_phonemize.html
|
||||||
343
.github/scripts/aishell/ASR/run.sh
vendored
Executable file
343
.github/scripts/aishell/ASR/run.sh
vendored
Executable file
@ -0,0 +1,343 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
log() {
|
||||||
|
# This function is from espnet
|
||||||
|
local fname=${BASH_SOURCE[1]##*/}
|
||||||
|
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
cd egs/aishell/ASR
|
||||||
|
|
||||||
|
function download_test_dev_manifests() {
|
||||||
|
git lfs install
|
||||||
|
|
||||||
|
fbank_url=https://huggingface.co/csukuangfj/aishell-test-dev-manifests
|
||||||
|
log "Downloading pre-commputed fbank from $fbank_url"
|
||||||
|
|
||||||
|
git clone https://huggingface.co/csukuangfj/aishell-test-dev-manifests
|
||||||
|
ln -s $PWD/aishell-test-dev-manifests/data .
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_transducer_stateless3_2022_06_20() {
|
||||||
|
repo_url=https://huggingface.co/csukuangfj/icefall-aishell-pruned-transducer-stateless3-2022-06-20
|
||||||
|
log "Downloading pre-trained model from $repo_url"
|
||||||
|
git clone $repo_url
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
|
||||||
|
log "Display test files"
|
||||||
|
tree $repo/
|
||||||
|
ls -lh $repo/test_wavs/*.wav
|
||||||
|
|
||||||
|
pushd $repo/exp
|
||||||
|
ln -s pretrained-epoch-29-avg-5-torch-1.10.0.pt pretrained.pt
|
||||||
|
popd
|
||||||
|
|
||||||
|
log "test greedy_search with pretrained.py"
|
||||||
|
|
||||||
|
for sym in 1 2 3; do
|
||||||
|
log "Greedy search with --max-sym-per-frame $sym"
|
||||||
|
|
||||||
|
./pruned_transducer_stateless3/pretrained.py \
|
||||||
|
--method greedy_search \
|
||||||
|
--max-sym-per-frame $sym \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--lang-dir $repo/data/lang_char \
|
||||||
|
$repo/test_wavs/BAC009S0764W0121.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0122.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0123.wav
|
||||||
|
done
|
||||||
|
|
||||||
|
log "test beam search with pretrained.py"
|
||||||
|
|
||||||
|
for method in modified_beam_search beam_search fast_beam_search; do
|
||||||
|
log "$method"
|
||||||
|
|
||||||
|
./pruned_transducer_stateless3/pretrained.py \
|
||||||
|
--method $method \
|
||||||
|
--beam-size 4 \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--lang-dir $repo/data/lang_char \
|
||||||
|
$repo/test_wavs/BAC009S0764W0121.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0122.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0123.wav
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
||||||
|
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
||||||
|
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
||||||
|
mkdir -p pruned_transducer_stateless3/exp
|
||||||
|
ln -s $PWD/$repo/exp/pretrained.pt pruned_transducer_stateless3/exp/epoch-999.pt
|
||||||
|
ln -s $PWD/$repo/data/lang_char data/
|
||||||
|
|
||||||
|
ls -lh data
|
||||||
|
ls -lh pruned_transducer_stateless3/exp
|
||||||
|
|
||||||
|
log "Decoding test and dev"
|
||||||
|
|
||||||
|
# use a small value for decoding with CPU
|
||||||
|
max_duration=100
|
||||||
|
|
||||||
|
for method in greedy_search fast_beam_search modified_beam_search; do
|
||||||
|
log "Decoding with $method"
|
||||||
|
|
||||||
|
./pruned_transducer_stateless3/decode.py \
|
||||||
|
--decoding-method $method \
|
||||||
|
--epoch 999 \
|
||||||
|
--avg 1 \
|
||||||
|
--max-duration $max_duration \
|
||||||
|
--exp-dir pruned_transducer_stateless3/exp
|
||||||
|
done
|
||||||
|
|
||||||
|
rm pruned_transducer_stateless3/exp/*.pt
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf $repo
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_zipformer_large_2023_10_24() {
|
||||||
|
log "CI testing large model"
|
||||||
|
repo_url=https://huggingface.co/zrjin/icefall-asr-aishell-zipformer-large-2023-10-24/
|
||||||
|
log "Downloading pre-trained model from $repo_url"
|
||||||
|
git clone $repo_url
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
|
||||||
|
log "Display test files"
|
||||||
|
tree $repo/
|
||||||
|
ls -lh $repo/test_wavs/*.wav
|
||||||
|
|
||||||
|
for method in modified_beam_search greedy_search fast_beam_search; do
|
||||||
|
log "$method"
|
||||||
|
|
||||||
|
./zipformer/pretrained.py \
|
||||||
|
--method $method \
|
||||||
|
--context-size 1 \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--tokens $repo/data/lang_char/tokens.txt \
|
||||||
|
--num-encoder-layers 2,2,4,5,4,2 \
|
||||||
|
--feedforward-dim 512,768,1536,2048,1536,768 \
|
||||||
|
--encoder-dim 192,256,512,768,512,256 \
|
||||||
|
--encoder-unmasked-dim 192,192,256,320,256,192 \
|
||||||
|
$repo/test_wavs/BAC009S0764W0121.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0122.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0123.wav
|
||||||
|
done
|
||||||
|
rm -rf $repo
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_zipformer_2023_10_24() {
|
||||||
|
repo_url=https://huggingface.co/zrjin/icefall-asr-aishell-zipformer-2023-10-24/
|
||||||
|
log "Downloading pre-trained model from $repo_url"
|
||||||
|
git clone $repo_url
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
|
||||||
|
log "Display test files"
|
||||||
|
tree $repo/
|
||||||
|
ls -lh $repo/test_wavs/*.wav
|
||||||
|
|
||||||
|
|
||||||
|
for method in modified_beam_search greedy_search fast_beam_search; do
|
||||||
|
log "$method"
|
||||||
|
|
||||||
|
./zipformer/pretrained.py \
|
||||||
|
--method $method \
|
||||||
|
--context-size 1 \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--tokens $repo/data/lang_char/tokens.txt \
|
||||||
|
$repo/test_wavs/BAC009S0764W0121.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0122.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0123.wav
|
||||||
|
done
|
||||||
|
rm -rf $repo
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_zipformer_small_2023_10_24() {
|
||||||
|
log "CI testing small model"
|
||||||
|
repo_url=https://huggingface.co/zrjin/icefall-asr-aishell-zipformer-small-2023-10-24/
|
||||||
|
log "Downloading pre-trained model from $repo_url"
|
||||||
|
git clone $repo_url
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
|
||||||
|
log "Display test files"
|
||||||
|
tree $repo/
|
||||||
|
ls -lh $repo/test_wavs/*.wav
|
||||||
|
|
||||||
|
|
||||||
|
for method in modified_beam_search greedy_search fast_beam_search; do
|
||||||
|
log "$method"
|
||||||
|
|
||||||
|
./zipformer/pretrained.py \
|
||||||
|
--method $method \
|
||||||
|
--context-size 1 \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--tokens $repo/data/lang_char/tokens.txt \
|
||||||
|
--num-encoder-layers 2,2,2,2,2,2 \
|
||||||
|
--feedforward-dim 512,768,768,768,768,768 \
|
||||||
|
--encoder-dim 192,256,256,256,256,256 \
|
||||||
|
--encoder-unmasked-dim 192,192,192,192,192,192 \
|
||||||
|
$repo/test_wavs/BAC009S0764W0121.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0122.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0123.wav
|
||||||
|
done
|
||||||
|
rm -rf $repo
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_transducer_stateless_modified_2022_03_01() {
|
||||||
|
repo_url=https://huggingface.co/csukuangfj/icefall-aishell-transducer-stateless-modified-2022-03-01
|
||||||
|
|
||||||
|
log "Downloading pre-trained model from $repo_url"
|
||||||
|
git lfs install
|
||||||
|
git clone $repo_url
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
|
||||||
|
log "Display test files"
|
||||||
|
tree $repo/
|
||||||
|
ls -lh $repo/test_wavs/*.wav
|
||||||
|
|
||||||
|
for sym in 1 2 3; do
|
||||||
|
log "Greedy search with --max-sym-per-frame $sym"
|
||||||
|
|
||||||
|
./transducer_stateless_modified/pretrained.py \
|
||||||
|
--method greedy_search \
|
||||||
|
--max-sym-per-frame $sym \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--lang-dir $repo/data/lang_char \
|
||||||
|
$repo/test_wavs/BAC009S0764W0121.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0122.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0123.wav
|
||||||
|
done
|
||||||
|
|
||||||
|
for method in modified_beam_search beam_search; do
|
||||||
|
log "$method"
|
||||||
|
|
||||||
|
./transducer_stateless_modified/pretrained.py \
|
||||||
|
--method $method \
|
||||||
|
--beam-size 4 \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--lang-dir $repo/data/lang_char \
|
||||||
|
$repo/test_wavs/BAC009S0764W0121.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0122.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0123.wav
|
||||||
|
done
|
||||||
|
rm -rf $repo
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_transducer_stateless_modified_2_2022_03_01() {
|
||||||
|
repo_url=https://huggingface.co/csukuangfj/icefall-aishell-transducer-stateless-modified-2-2022-03-01
|
||||||
|
|
||||||
|
log "Downloading pre-trained model from $repo_url"
|
||||||
|
git lfs install
|
||||||
|
git clone $repo_url
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
|
||||||
|
log "Display test files"
|
||||||
|
tree $repo/
|
||||||
|
ls -lh $repo/test_wavs/*.wav
|
||||||
|
|
||||||
|
for sym in 1 2 3; do
|
||||||
|
log "Greedy search with --max-sym-per-frame $sym"
|
||||||
|
|
||||||
|
./transducer_stateless_modified-2/pretrained.py \
|
||||||
|
--method greedy_search \
|
||||||
|
--max-sym-per-frame $sym \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--lang-dir $repo/data/lang_char \
|
||||||
|
$repo/test_wavs/BAC009S0764W0121.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0122.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0123.wav
|
||||||
|
done
|
||||||
|
|
||||||
|
for method in modified_beam_search beam_search; do
|
||||||
|
log "$method"
|
||||||
|
|
||||||
|
./transducer_stateless_modified-2/pretrained.py \
|
||||||
|
--method $method \
|
||||||
|
--beam-size 4 \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--lang-dir $repo/data/lang_char \
|
||||||
|
$repo/test_wavs/BAC009S0764W0121.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0122.wav \
|
||||||
|
$repo/test_wavs/BAC009S0764W0123.wav
|
||||||
|
done
|
||||||
|
rm -rf $repo
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_conformer_ctc() {
|
||||||
|
repo_url=https://huggingface.co/csukuangfj/icefall_asr_aishell_conformer_ctc
|
||||||
|
log "Downloading pre-trained model from $repo_url"
|
||||||
|
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
pushd $repo
|
||||||
|
|
||||||
|
git lfs pull --include "exp/pretrained.pt"
|
||||||
|
git lfs pull --include "data/lang_char/H.fst"
|
||||||
|
git lfs pull --include "data/lang_char/HL.fst"
|
||||||
|
git lfs pull --include "data/lang_char/HLG.fst"
|
||||||
|
|
||||||
|
popd
|
||||||
|
|
||||||
|
log "Display test files"
|
||||||
|
tree $repo/
|
||||||
|
ls -lh $repo/test_wavs/*.wav
|
||||||
|
|
||||||
|
log "CTC decoding"
|
||||||
|
|
||||||
|
log "Exporting model with torchscript"
|
||||||
|
|
||||||
|
pushd $repo/exp
|
||||||
|
ln -s pretrained.pt epoch-99.pt
|
||||||
|
popd
|
||||||
|
|
||||||
|
./conformer_ctc/export.py \
|
||||||
|
--epoch 99 \
|
||||||
|
--avg 1 \
|
||||||
|
--exp-dir $repo/exp \
|
||||||
|
--tokens $repo/data/lang_char/tokens.txt \
|
||||||
|
--jit 1
|
||||||
|
|
||||||
|
ls -lh $repo/exp
|
||||||
|
|
||||||
|
ls -lh $repo/data/lang_char
|
||||||
|
|
||||||
|
log "Decoding with H on CPU with OpenFst"
|
||||||
|
|
||||||
|
./conformer_ctc/jit_pretrained_decode_with_H.py \
|
||||||
|
--nn-model $repo/exp/cpu_jit.pt \
|
||||||
|
--H $repo/data/lang_char/H.fst \
|
||||||
|
--tokens $repo/data/lang_char/tokens.txt \
|
||||||
|
$repo/test_wavs/0.wav \
|
||||||
|
$repo/test_wavs/1.wav \
|
||||||
|
$repo/test_wavs/2.wav
|
||||||
|
|
||||||
|
log "Decoding with HL on CPU with OpenFst"
|
||||||
|
|
||||||
|
./conformer_ctc/jit_pretrained_decode_with_HL.py \
|
||||||
|
--nn-model $repo/exp/cpu_jit.pt \
|
||||||
|
--HL $repo/data/lang_char/HL.fst \
|
||||||
|
--words $repo/data/lang_char/words.txt \
|
||||||
|
$repo/test_wavs/0.wav \
|
||||||
|
$repo/test_wavs/1.wav \
|
||||||
|
$repo/test_wavs/2.wav
|
||||||
|
|
||||||
|
log "Decoding with HLG on CPU with OpenFst"
|
||||||
|
|
||||||
|
./conformer_ctc/jit_pretrained_decode_with_HLG.py \
|
||||||
|
--nn-model $repo/exp/cpu_jit.pt \
|
||||||
|
--HLG $repo/data/lang_char/HLG.fst \
|
||||||
|
--words $repo/data/lang_char/words.txt \
|
||||||
|
$repo/test_wavs/0.wav \
|
||||||
|
$repo/test_wavs/1.wav \
|
||||||
|
$repo/test_wavs/2.wav
|
||||||
|
|
||||||
|
rm -rf $repo
|
||||||
|
}
|
||||||
|
|
||||||
|
download_test_dev_manifests
|
||||||
|
test_transducer_stateless3_2022_06_20
|
||||||
|
test_zipformer_large_2023_10_24
|
||||||
|
test_zipformer_2023_10_24
|
||||||
|
test_zipformer_small_2023_10_24
|
||||||
|
test_transducer_stateless_modified_2022_03_01
|
||||||
|
test_transducer_stateless_modified_2_2022_03_01
|
||||||
|
# test_conformer_ctc # fails for torch 1.13.x and torch 2.0.x
|
||||||
94
.github/scripts/audioset/AT/run.sh
vendored
Executable file
94
.github/scripts/audioset/AT/run.sh
vendored
Executable file
@ -0,0 +1,94 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
python3 -m pip install onnxoptimizer onnxsim
|
||||||
|
|
||||||
|
log() {
|
||||||
|
# This function is from espnet
|
||||||
|
local fname=${BASH_SOURCE[1]##*/}
|
||||||
|
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
cd egs/audioset/AT
|
||||||
|
|
||||||
|
function test_pretrained() {
|
||||||
|
repo_url=https://huggingface.co/marcoyang/icefall-audio-tagging-audioset-zipformer-2024-03-12
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
||||||
|
pushd $repo/exp
|
||||||
|
git lfs pull --include pretrained.pt
|
||||||
|
ln -s pretrained.pt epoch-99.pt
|
||||||
|
ls -lh
|
||||||
|
popd
|
||||||
|
|
||||||
|
log "test pretrained.pt"
|
||||||
|
|
||||||
|
python3 zipformer/pretrained.py \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--label-dict $repo/data/class_labels_indices.csv \
|
||||||
|
$repo/test_wavs/1.wav \
|
||||||
|
$repo/test_wavs/2.wav \
|
||||||
|
$repo/test_wavs/3.wav \
|
||||||
|
$repo/test_wavs/4.wav
|
||||||
|
|
||||||
|
log "test jit export"
|
||||||
|
ls -lh $repo/exp/
|
||||||
|
python3 zipformer/export.py \
|
||||||
|
--exp-dir $repo/exp \
|
||||||
|
--epoch 99 \
|
||||||
|
--avg 1 \
|
||||||
|
--use-averaged-model 0 \
|
||||||
|
--jit 1
|
||||||
|
ls -lh $repo/exp/
|
||||||
|
|
||||||
|
log "test jit models"
|
||||||
|
python3 zipformer/jit_pretrained.py \
|
||||||
|
--nn-model-filename $repo/exp/jit_script.pt \
|
||||||
|
--label-dict $repo/data/class_labels_indices.csv \
|
||||||
|
$repo/test_wavs/1.wav \
|
||||||
|
$repo/test_wavs/2.wav \
|
||||||
|
$repo/test_wavs/3.wav \
|
||||||
|
$repo/test_wavs/4.wav
|
||||||
|
|
||||||
|
log "test onnx export"
|
||||||
|
ls -lh $repo/exp/
|
||||||
|
python3 zipformer/export-onnx.py \
|
||||||
|
--exp-dir $repo/exp \
|
||||||
|
--epoch 99 \
|
||||||
|
--avg 1 \
|
||||||
|
--use-averaged-model 0
|
||||||
|
|
||||||
|
ls -lh $repo/exp/
|
||||||
|
|
||||||
|
pushd $repo/exp/
|
||||||
|
mv model-epoch-99-avg-1.onnx model.onnx
|
||||||
|
mv model-epoch-99-avg-1.int8.onnx model.int8.onnx
|
||||||
|
popd
|
||||||
|
|
||||||
|
ls -lh $repo/exp/
|
||||||
|
|
||||||
|
log "test onnx models"
|
||||||
|
for m in model.onnx model.int8.onnx; do
|
||||||
|
log "$m"
|
||||||
|
python3 zipformer/onnx_pretrained.py \
|
||||||
|
--model-filename $repo/exp/model.onnx \
|
||||||
|
--label-dict $repo/data/class_labels_indices.csv \
|
||||||
|
$repo/test_wavs/1.wav \
|
||||||
|
$repo/test_wavs/2.wav \
|
||||||
|
$repo/test_wavs/3.wav \
|
||||||
|
$repo/test_wavs/4.wav
|
||||||
|
done
|
||||||
|
|
||||||
|
log "prepare data for uploading to huggingface"
|
||||||
|
dst=/icefall/model-onnx
|
||||||
|
mkdir -p $dst
|
||||||
|
cp -v $repo/exp/*.onnx $dst/
|
||||||
|
cp -v $repo/data/* $dst/
|
||||||
|
cp -av $repo/test_wavs $dst
|
||||||
|
|
||||||
|
ls -lh $dst
|
||||||
|
ls -lh $dst/test_wavs
|
||||||
|
}
|
||||||
|
|
||||||
|
test_pretrained
|
||||||
71
.github/scripts/docker/Dockerfile
vendored
Normal file
71
.github/scripts/docker/Dockerfile
vendored
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
ARG PYTHON_VERSION=3.8
|
||||||
|
FROM python:${PYTHON_VERSION}
|
||||||
|
|
||||||
|
ARG TORCHAUDIO_VERSION="0.13.0"
|
||||||
|
ARG TORCH_VERSION="1.13.0"
|
||||||
|
ARG K2_VERSION="1.24.4.dev20231220"
|
||||||
|
ARG KALDIFEAT_VERSION="1.25.3.dev20231221"
|
||||||
|
|
||||||
|
ARG _K2_VERSION="${K2_VERSION}+cpu.torch${TORCH_VERSION}"
|
||||||
|
ARG _KALDIFEAT_VERSION="${KALDIFEAT_VERSION}+cpu.torch${TORCH_VERSION}"
|
||||||
|
|
||||||
|
RUN apt-get update -y && \
|
||||||
|
apt-get install -qq -y \
|
||||||
|
cmake \
|
||||||
|
ffmpeg \
|
||||||
|
git \
|
||||||
|
git-lfs \
|
||||||
|
graphviz \
|
||||||
|
less \
|
||||||
|
tree \
|
||||||
|
vim \
|
||||||
|
&& \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf /var/cache/apt/archives /var/lib/apt/lists
|
||||||
|
|
||||||
|
|
||||||
|
LABEL authors="Fangjun Kuang <csukuangfj@gmail.com>"
|
||||||
|
LABEL k2_version=${_K2_VERSION}
|
||||||
|
LABEL kaldifeat_version=${_KALDIFEAT_VERSION}
|
||||||
|
LABEL github_repo="https://github.com/k2-fsa/icefall"
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN pip install --no-cache-dir \
|
||||||
|
torch==${TORCH_VERSION} torchaudio==${TORCHAUDIO_VERSION} -f https://download.pytorch.org/whl/cpu/torch_stable.html \
|
||||||
|
k2==${_K2_VERSION} -f https://k2-fsa.github.io/k2/cpu.html \
|
||||||
|
\
|
||||||
|
git+https://github.com/lhotse-speech/lhotse \
|
||||||
|
kaldifeat==${_KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cpu.html \
|
||||||
|
cython \
|
||||||
|
dill \
|
||||||
|
espnet_tts_frontend \
|
||||||
|
graphviz \
|
||||||
|
kaldi-decoder \
|
||||||
|
kaldi_native_io \
|
||||||
|
kaldialign \
|
||||||
|
kaldifst \
|
||||||
|
kaldilm \
|
||||||
|
matplotlib \
|
||||||
|
multi_quantization \
|
||||||
|
numba \
|
||||||
|
numpy \
|
||||||
|
onnxoptimizer \
|
||||||
|
onnxsim \
|
||||||
|
onnx \
|
||||||
|
onnxmltools \
|
||||||
|
onnxruntime \
|
||||||
|
piper_phonemize -f https://k2-fsa.github.io/icefall/piper_phonemize.html \
|
||||||
|
pypinyin==0.50.0 \
|
||||||
|
pytest \
|
||||||
|
sentencepiece>=0.1.96 \
|
||||||
|
six \
|
||||||
|
tensorboard \
|
||||||
|
typeguard
|
||||||
|
|
||||||
|
# RUN git clone https://github.com/k2-fsa/icefall /workspace/icefall && \
|
||||||
|
# cd /workspace/icefall && \
|
||||||
|
# pip install --no-cache-dir -r requirements.txt
|
||||||
|
#
|
||||||
|
# ENV PYTHONPATH /workspace/icefall:$PYTHONPATH
|
||||||
|
#
|
||||||
|
# WORKDIR /workspace/icefall
|
||||||
110
.github/scripts/docker/generate_build_matrix.py
vendored
Executable file
110
.github/scripts/docker/generate_build_matrix.py
vendored
Executable file
@ -0,0 +1,110 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# Copyright 2023 Xiaomi Corp. (authors: Fangjun Kuang)
|
||||||
|
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
def version_gt(a, b):
|
||||||
|
a_major, a_minor = list(map(int, a.split(".")))[:2]
|
||||||
|
b_major, b_minor = list(map(int, b.split(".")))[:2]
|
||||||
|
if a_major > b_major:
|
||||||
|
return True
|
||||||
|
|
||||||
|
if a_major == b_major and a_minor > b_minor:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def version_ge(a, b):
|
||||||
|
a_major, a_minor = list(map(int, a.split(".")))[:2]
|
||||||
|
b_major, b_minor = list(map(int, b.split(".")))[:2]
|
||||||
|
if a_major > b_major:
|
||||||
|
return True
|
||||||
|
|
||||||
|
if a_major == b_major and a_minor >= b_minor:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def get_torchaudio_version(torch_version):
|
||||||
|
if torch_version == "1.13.0":
|
||||||
|
return "0.13.0"
|
||||||
|
elif torch_version == "1.13.1":
|
||||||
|
return "0.13.1"
|
||||||
|
elif torch_version == "2.0.0":
|
||||||
|
return "2.0.1"
|
||||||
|
elif torch_version == "2.0.1":
|
||||||
|
return "2.0.2"
|
||||||
|
else:
|
||||||
|
return torch_version
|
||||||
|
|
||||||
|
|
||||||
|
def get_matrix():
|
||||||
|
k2_version = "1.24.4.dev20240223"
|
||||||
|
kaldifeat_version = "1.25.4.dev20240223"
|
||||||
|
version = "20240905"
|
||||||
|
python_version = ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||||
|
torch_version = []
|
||||||
|
# torch_version += ["1.13.0", "1.13.1"]
|
||||||
|
# torch_version += ["2.0.0", "2.0.1"]
|
||||||
|
# torch_version += ["2.1.0", "2.1.1", "2.1.2"]
|
||||||
|
# torch_version += ["2.2.0", "2.2.1", "2.2.2"]
|
||||||
|
# Test only torch >= 2.3.0
|
||||||
|
torch_version += ["2.3.0", "2.3.1"]
|
||||||
|
torch_version += ["2.4.0"]
|
||||||
|
torch_version += ["2.4.1"]
|
||||||
|
|
||||||
|
matrix = []
|
||||||
|
for p in python_version:
|
||||||
|
for t in torch_version:
|
||||||
|
# torchaudio <= 1.13.x supports only python <= 3.10
|
||||||
|
|
||||||
|
if version_gt(p, "3.10") and not version_gt(t, "2.0"):
|
||||||
|
continue
|
||||||
|
|
||||||
|
# only torch>=2.2.0 supports python 3.12
|
||||||
|
if version_gt(p, "3.11") and not version_gt(t, "2.1"):
|
||||||
|
continue
|
||||||
|
|
||||||
|
k2_version_2 = k2_version
|
||||||
|
kaldifeat_version_2 = kaldifeat_version
|
||||||
|
|
||||||
|
if t == "2.2.2":
|
||||||
|
k2_version_2 = "1.24.4.dev20240328"
|
||||||
|
kaldifeat_version_2 = "1.25.4.dev20240329"
|
||||||
|
elif t == "2.3.0":
|
||||||
|
k2_version_2 = "1.24.4.dev20240425"
|
||||||
|
kaldifeat_version_2 = "1.25.4.dev20240425"
|
||||||
|
elif t == "2.3.1":
|
||||||
|
k2_version_2 = "1.24.4.dev20240606"
|
||||||
|
kaldifeat_version_2 = "1.25.4.dev20240606"
|
||||||
|
elif t == "2.4.0":
|
||||||
|
k2_version_2 = "1.24.4.dev20240725"
|
||||||
|
kaldifeat_version_2 = "1.25.4.dev20240725"
|
||||||
|
elif t == "2.4.1":
|
||||||
|
k2_version_2 = "1.24.4.dev20240905"
|
||||||
|
kaldifeat_version_2 = "1.25.4.dev20240905"
|
||||||
|
|
||||||
|
matrix.append(
|
||||||
|
{
|
||||||
|
"k2-version": k2_version_2,
|
||||||
|
"kaldifeat-version": kaldifeat_version_2,
|
||||||
|
"version": version,
|
||||||
|
"python-version": p,
|
||||||
|
"torch-version": t,
|
||||||
|
"torchaudio-version": get_torchaudio_version(t),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return matrix
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
matrix = get_matrix()
|
||||||
|
print(json.dumps({"include": matrix}))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
29
.github/scripts/generate-piper-phonemize-page.py
vendored
Executable file
29
.github/scripts/generate-piper-phonemize-page.py
vendored
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
prefix = (
|
||||||
|
"https://github.com/csukuangfj/piper-phonemize/releases/download/2023.12.5/"
|
||||||
|
)
|
||||||
|
files = [
|
||||||
|
"piper_phonemize-1.2.0-cp310-cp310-macosx_10_14_x86_64.whl",
|
||||||
|
"piper_phonemize-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
|
||||||
|
"piper_phonemize-1.2.0-cp311-cp311-macosx_10_14_x86_64.whl",
|
||||||
|
"piper_phonemize-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
|
||||||
|
"piper_phonemize-1.2.0-cp312-cp312-macosx_10_14_x86_64.whl",
|
||||||
|
"piper_phonemize-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
|
||||||
|
"piper_phonemize-1.2.0-cp37-cp37m-macosx_10_14_x86_64.whl",
|
||||||
|
"piper_phonemize-1.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
|
||||||
|
"piper_phonemize-1.2.0-cp38-cp38-macosx_10_14_x86_64.whl",
|
||||||
|
"piper_phonemize-1.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
|
||||||
|
"piper_phonemize-1.2.0-cp39-cp39-macosx_10_14_x86_64.whl",
|
||||||
|
"piper_phonemize-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
|
||||||
|
]
|
||||||
|
with open("piper_phonemize.html", "w") as f:
|
||||||
|
for file in files:
|
||||||
|
url = prefix + file
|
||||||
|
f.write(f'<a href="{url}">{file}</a><br/>\n')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
132
.github/scripts/ksponspeech/ASR/run.sh
vendored
Executable file
132
.github/scripts/ksponspeech/ASR/run.sh
vendored
Executable file
@ -0,0 +1,132 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
log() {
|
||||||
|
# This function is from espnet
|
||||||
|
local fname=${BASH_SOURCE[1]##*/}
|
||||||
|
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
cd egs/ksponspeech/ASR
|
||||||
|
|
||||||
|
|
||||||
|
function test_pretrained_non_streaming() {
|
||||||
|
git lfs install
|
||||||
|
git clone https://huggingface.co/johnBamma/icefall-asr-ksponspeech-zipformer-2024-06-24
|
||||||
|
repo=icefall-asr-ksponspeech-zipformer-2024-06-24
|
||||||
|
pushd $repo
|
||||||
|
mkdir test_wavs
|
||||||
|
cd test_wavs
|
||||||
|
curl -SL -O https://huggingface.co/k2-fsa/sherpa-onnx-streaming-zipformer-korean-2024-06-16/resolve/main/test_wavs/0.wav
|
||||||
|
curl -SL -O https://huggingface.co/k2-fsa/sherpa-onnx-streaming-zipformer-korean-2024-06-16/resolve/main/test_wavs/1.wav
|
||||||
|
curl -SL -O https://huggingface.co/k2-fsa/sherpa-onnx-streaming-zipformer-korean-2024-06-16/resolve/main/test_wavs/2.wav
|
||||||
|
curl -SL -O https://huggingface.co/k2-fsa/sherpa-onnx-streaming-zipformer-korean-2024-06-16/resolve/main/test_wavs/3.wav
|
||||||
|
curl -SL -O https://huggingface.co/k2-fsa/sherpa-onnx-streaming-zipformer-korean-2024-06-16/resolve/main/test_wavs/trans.txt
|
||||||
|
cd ../exp
|
||||||
|
ln -s pretrained.pt epoch-99.pt
|
||||||
|
ls -lh
|
||||||
|
popd
|
||||||
|
|
||||||
|
log 'test pretrained.py'
|
||||||
|
./zipformer/pretrained.py \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--tokens $repo/data/lang_bpe_5000/tokens.txt \
|
||||||
|
--method greedy_search \
|
||||||
|
$repo/test_wavs/0.wav \
|
||||||
|
$repo/test_wavs/1.wav \
|
||||||
|
$repo/test_wavs/2.wav \
|
||||||
|
$repo/test_wavs/3.wav
|
||||||
|
|
||||||
|
log 'test export-onnx.py'
|
||||||
|
|
||||||
|
./zipformer/export-onnx.py \
|
||||||
|
--tokens $repo/data/lang_bpe_5000/tokens.txt \
|
||||||
|
--use-averaged-model 0 \
|
||||||
|
--epoch 99 \
|
||||||
|
--avg 1 \
|
||||||
|
--exp-dir $repo/exp/
|
||||||
|
|
||||||
|
ls -lh $repo/exp
|
||||||
|
|
||||||
|
ls -lh $repo/data/lang_bpe_5000/
|
||||||
|
|
||||||
|
log 'test exported onnx models'
|
||||||
|
./zipformer/onnx_pretrained.py \
|
||||||
|
--encoder-model-filename $repo/exp/encoder-epoch-99-avg-1.onnx \
|
||||||
|
--decoder-model-filename $repo/exp/decoder-epoch-99-avg-1.onnx \
|
||||||
|
--joiner-model-filename $repo/exp/joiner-epoch-99-avg-1.onnx \
|
||||||
|
--tokens $repo/data/lang_bpe_5000/tokens.txt \
|
||||||
|
$repo/test_wavs/0.wav
|
||||||
|
|
||||||
|
dst=/tmp/model-2024-06-24
|
||||||
|
mkdir -p $dst
|
||||||
|
|
||||||
|
cp -av $repo/test_wavs $dst
|
||||||
|
cp -v $repo/exp/*.onnx $dst
|
||||||
|
cp -v $repo/exp/*.onnx $dst
|
||||||
|
cp -v $repo/data/lang_bpe_5000/tokens.txt $dst
|
||||||
|
cp -v $repo/data/lang_bpe_5000/bpe.model $dst
|
||||||
|
rm -rf $repo
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_pretrained_streaming() {
|
||||||
|
git lfs install
|
||||||
|
git clone https://huggingface.co/johnBamma/icefall-asr-ksponspeech-pruned-transducer-stateless7-streaming-2024-06-12
|
||||||
|
repo=icefall-asr-ksponspeech-pruned-transducer-stateless7-streaming-2024-06-12
|
||||||
|
pushd $repo
|
||||||
|
mkdir test_wavs
|
||||||
|
cd test_wavs
|
||||||
|
curl -SL -O https://huggingface.co/k2-fsa/sherpa-onnx-streaming-zipformer-korean-2024-06-16/resolve/main/test_wavs/0.wav
|
||||||
|
curl -SL -O https://huggingface.co/k2-fsa/sherpa-onnx-streaming-zipformer-korean-2024-06-16/resolve/main/test_wavs/1.wav
|
||||||
|
curl -SL -O https://huggingface.co/k2-fsa/sherpa-onnx-streaming-zipformer-korean-2024-06-16/resolve/main/test_wavs/2.wav
|
||||||
|
curl -SL -O https://huggingface.co/k2-fsa/sherpa-onnx-streaming-zipformer-korean-2024-06-16/resolve/main/test_wavs/3.wav
|
||||||
|
cd ../exp
|
||||||
|
ln -s pretrained.pt epoch-99.pt
|
||||||
|
ls -lh
|
||||||
|
popd
|
||||||
|
|
||||||
|
log 'test pretrained.py'
|
||||||
|
./pruned_transducer_stateless7_streaming/pretrained.py \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--tokens $repo/data/lang_bpe_5000/tokens.txt \
|
||||||
|
--method greedy_search \
|
||||||
|
$repo/test_wavs/0.wav \
|
||||||
|
$repo/test_wavs/1.wav \
|
||||||
|
$repo/test_wavs/2.wav \
|
||||||
|
$repo/test_wavs/3.wav
|
||||||
|
|
||||||
|
log 'test export-onnx.py'
|
||||||
|
|
||||||
|
./pruned_transducer_stateless7_streaming/export-onnx.py \
|
||||||
|
--tokens $repo/data/lang_bpe_5000/tokens.txt \
|
||||||
|
--use-averaged-model 0 \
|
||||||
|
--epoch 99 \
|
||||||
|
--avg 1 \
|
||||||
|
--decode-chunk-len 32 \
|
||||||
|
--exp-dir $repo/exp/
|
||||||
|
|
||||||
|
ls -lh $repo/exp
|
||||||
|
|
||||||
|
ls -lh $repo/data/lang_bpe_5000/
|
||||||
|
|
||||||
|
log 'test exported onnx models'
|
||||||
|
./pruned_transducer_stateless7_streaming/onnx_pretrained.py \
|
||||||
|
--encoder-model-filename $repo/exp/encoder-epoch-99-avg-1.onnx \
|
||||||
|
--decoder-model-filename $repo/exp/decoder-epoch-99-avg-1.onnx \
|
||||||
|
--joiner-model-filename $repo/exp/joiner-epoch-99-avg-1.onnx \
|
||||||
|
--tokens $repo/data/lang_bpe_5000/tokens.txt \
|
||||||
|
$repo/test_wavs/0.wav
|
||||||
|
|
||||||
|
dst=/tmp/model-2024-06-16
|
||||||
|
mkdir -p $dst
|
||||||
|
|
||||||
|
cp -v $repo/exp/*.onnx $dst
|
||||||
|
cp -v $repo/exp/*.onnx $dst
|
||||||
|
cp -v $repo/data/lang_bpe_5000/tokens.txt $dst
|
||||||
|
cp -v $repo/data/lang_bpe_5000/bpe.model $dst
|
||||||
|
rm -rf $repo
|
||||||
|
}
|
||||||
|
|
||||||
|
test_pretrained_non_streaming
|
||||||
|
test_pretrained_streaming
|
||||||
1644
.github/scripts/librispeech/ASR/run.sh
vendored
Executable file
1644
.github/scripts/librispeech/ASR/run.sh
vendored
Executable file
File diff suppressed because it is too large
Load Diff
157
.github/scripts/ljspeech/TTS/run.sh
vendored
Executable file
157
.github/scripts/ljspeech/TTS/run.sh
vendored
Executable file
@ -0,0 +1,157 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
python3 -m pip install piper_phonemize -f https://k2-fsa.github.io/icefall/piper_phonemize.html
|
||||||
|
python3 -m pip install espnet_tts_frontend
|
||||||
|
python3 -m pip install numba
|
||||||
|
|
||||||
|
log() {
|
||||||
|
# This function is from espnet
|
||||||
|
local fname=${BASH_SOURCE[1]##*/}
|
||||||
|
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
cd egs/ljspeech/TTS
|
||||||
|
|
||||||
|
sed -i.bak s/600/8/g ./prepare.sh
|
||||||
|
sed -i.bak s/"first 100"/"first 3"/g ./prepare.sh
|
||||||
|
sed -i.bak s/500/5/g ./prepare.sh
|
||||||
|
git diff
|
||||||
|
|
||||||
|
function prepare_data() {
|
||||||
|
# We have created a subset of the data for testing
|
||||||
|
#
|
||||||
|
mkdir download
|
||||||
|
pushd download
|
||||||
|
wget -q https://huggingface.co/csukuangfj/ljspeech-subset-for-ci-test/resolve/main/LJSpeech-1.1.tar.bz2
|
||||||
|
tar xvf LJSpeech-1.1.tar.bz2
|
||||||
|
popd
|
||||||
|
|
||||||
|
./prepare.sh
|
||||||
|
tree .
|
||||||
|
}
|
||||||
|
|
||||||
|
function train() {
|
||||||
|
pushd ./vits
|
||||||
|
sed -i.bak s/200/3/g ./train.py
|
||||||
|
git diff .
|
||||||
|
popd
|
||||||
|
|
||||||
|
for t in low medium high; do
|
||||||
|
./vits/train.py \
|
||||||
|
--exp-dir vits/exp-$t \
|
||||||
|
--model-type $t \
|
||||||
|
--num-epochs 1 \
|
||||||
|
--save-every-n 1 \
|
||||||
|
--num-buckets 2 \
|
||||||
|
--tokens data/tokens.txt \
|
||||||
|
--max-duration 20
|
||||||
|
|
||||||
|
ls -lh vits/exp-$t
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
function infer() {
|
||||||
|
for t in low medium high; do
|
||||||
|
./vits/infer.py \
|
||||||
|
--num-buckets 2 \
|
||||||
|
--model-type $t \
|
||||||
|
--epoch 1 \
|
||||||
|
--exp-dir ./vits/exp-$t \
|
||||||
|
--tokens data/tokens.txt \
|
||||||
|
--max-duration 20
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
function export_onnx() {
|
||||||
|
for t in low medium high; do
|
||||||
|
./vits/export-onnx.py \
|
||||||
|
--model-type $t \
|
||||||
|
--epoch 1 \
|
||||||
|
--exp-dir ./vits/exp-$t \
|
||||||
|
--tokens data/tokens.txt
|
||||||
|
|
||||||
|
ls -lh vits/exp-$t/
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_medium() {
|
||||||
|
git clone https://huggingface.co/csukuangfj/icefall-tts-ljspeech-vits-medium-2024-03-12
|
||||||
|
|
||||||
|
./vits/export-onnx.py \
|
||||||
|
--model-type medium \
|
||||||
|
--epoch 820 \
|
||||||
|
--exp-dir ./icefall-tts-ljspeech-vits-medium-2024-03-12/exp \
|
||||||
|
--tokens ./icefall-tts-ljspeech-vits-medium-2024-03-12/data/tokens.txt
|
||||||
|
|
||||||
|
ls -lh ./icefall-tts-ljspeech-vits-medium-2024-03-12/exp
|
||||||
|
|
||||||
|
./vits/test_onnx.py \
|
||||||
|
--model-filename ./icefall-tts-ljspeech-vits-medium-2024-03-12/exp/vits-epoch-820.onnx \
|
||||||
|
--tokens ./icefall-tts-ljspeech-vits-medium-2024-03-12/data/tokens.txt \
|
||||||
|
--output-filename /icefall/test-medium.wav
|
||||||
|
|
||||||
|
ls -lh /icefall/test-medium.wav
|
||||||
|
|
||||||
|
d=/icefall/vits-icefall-en_US-ljspeech-medium
|
||||||
|
mkdir $d
|
||||||
|
cp -v ./icefall-tts-ljspeech-vits-medium-2024-03-12/data/tokens.txt $d/
|
||||||
|
cp -v ./icefall-tts-ljspeech-vits-medium-2024-03-12/exp/vits-epoch-820.onnx $d/model.onnx
|
||||||
|
|
||||||
|
rm -rf icefall-tts-ljspeech-vits-medium-2024-03-12
|
||||||
|
|
||||||
|
pushd $d
|
||||||
|
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/espeak-ng-data.tar.bz2
|
||||||
|
tar xf espeak-ng-data.tar.bz2
|
||||||
|
rm espeak-ng-data.tar.bz2
|
||||||
|
cd ..
|
||||||
|
tar cjf vits-icefall-en_US-ljspeech-medium.tar.bz2 vits-icefall-en_US-ljspeech-medium
|
||||||
|
rm -rf vits-icefall-en_US-ljspeech-medium
|
||||||
|
ls -lh *.tar.bz2
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_low() {
|
||||||
|
git clone https://huggingface.co/csukuangfj/icefall-tts-ljspeech-vits-low-2024-03-12
|
||||||
|
|
||||||
|
./vits/export-onnx.py \
|
||||||
|
--model-type low \
|
||||||
|
--epoch 1600 \
|
||||||
|
--exp-dir ./icefall-tts-ljspeech-vits-low-2024-03-12/exp \
|
||||||
|
--tokens ./icefall-tts-ljspeech-vits-low-2024-03-12/data/tokens.txt
|
||||||
|
|
||||||
|
ls -lh ./icefall-tts-ljspeech-vits-low-2024-03-12/exp
|
||||||
|
|
||||||
|
./vits/test_onnx.py \
|
||||||
|
--model-filename ./icefall-tts-ljspeech-vits-low-2024-03-12/exp/vits-epoch-1600.onnx \
|
||||||
|
--tokens ./icefall-tts-ljspeech-vits-low-2024-03-12/data/tokens.txt \
|
||||||
|
--output-filename /icefall/test-low.wav
|
||||||
|
|
||||||
|
ls -lh /icefall/test-low.wav
|
||||||
|
|
||||||
|
d=/icefall/vits-icefall-en_US-ljspeech-low
|
||||||
|
mkdir $d
|
||||||
|
cp -v ./icefall-tts-ljspeech-vits-low-2024-03-12/data/tokens.txt $d/
|
||||||
|
cp -v ./icefall-tts-ljspeech-vits-low-2024-03-12/exp/vits-epoch-1600.onnx $d/model.onnx
|
||||||
|
|
||||||
|
rm -rf icefall-tts-ljspeech-vits-low-2024-03-12
|
||||||
|
|
||||||
|
pushd $d
|
||||||
|
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/espeak-ng-data.tar.bz2
|
||||||
|
tar xf espeak-ng-data.tar.bz2
|
||||||
|
rm espeak-ng-data.tar.bz2
|
||||||
|
cd ..
|
||||||
|
tar cjf vits-icefall-en_US-ljspeech-low.tar.bz2 vits-icefall-en_US-ljspeech-low
|
||||||
|
rm -rf vits-icefall-en_US-ljspeech-low
|
||||||
|
ls -lh *.tar.bz2
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
|
prepare_data
|
||||||
|
train
|
||||||
|
infer
|
||||||
|
export_onnx
|
||||||
|
rm -rf vits/exp-{low,medium,high}
|
||||||
|
test_medium
|
||||||
|
test_low
|
||||||
200
.github/scripts/multi-zh-hans.sh
vendored
Executable file
200
.github/scripts/multi-zh-hans.sh
vendored
Executable file
@ -0,0 +1,200 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
git config --global user.name "k2-fsa"
|
||||||
|
git config --global user.email "csukuangfj@gmail.com"
|
||||||
|
git config --global lfs.allowincompletepush true
|
||||||
|
|
||||||
|
log() {
|
||||||
|
# This function is from espnet
|
||||||
|
local fname=${BASH_SOURCE[1]##*/}
|
||||||
|
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
log "pwd: $PWD"
|
||||||
|
|
||||||
|
cd egs/multi_zh-hans/ASR
|
||||||
|
|
||||||
|
repo_url=https://huggingface.co/zrjin/icefall-asr-multi-zh-hans-zipformer-2023-9-2
|
||||||
|
log "Downloading pre-trained model from $repo_url"
|
||||||
|
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
pushd $repo
|
||||||
|
cd exp
|
||||||
|
git lfs pull --include pretrained.pt
|
||||||
|
ln -s pretrained.pt epoch-99.pt
|
||||||
|
cd ../data/lang_bpe_2000
|
||||||
|
ls -lh
|
||||||
|
git lfs pull --include L.pt L_disambig.pt Linv.pt bpe.model
|
||||||
|
git lfs pull --include "*.model"
|
||||||
|
ls -lh
|
||||||
|
popd
|
||||||
|
|
||||||
|
log "--------------------------------------------"
|
||||||
|
log "Export non-streaming ONNX transducer models "
|
||||||
|
log "--------------------------------------------"
|
||||||
|
./zipformer/export-onnx.py \
|
||||||
|
--tokens $repo/data/lang_bpe_2000/tokens.txt \
|
||||||
|
--use-averaged-model 0 \
|
||||||
|
--epoch 99 \
|
||||||
|
--avg 1 \
|
||||||
|
--exp-dir $repo/exp \
|
||||||
|
--causal False
|
||||||
|
|
||||||
|
ls -lh $repo/exp
|
||||||
|
|
||||||
|
./zipformer/onnx_pretrained.py \
|
||||||
|
--encoder-model-filename $repo/exp/encoder-epoch-99-avg-1.onnx \
|
||||||
|
--decoder-model-filename $repo/exp/decoder-epoch-99-avg-1.onnx \
|
||||||
|
--joiner-model-filename $repo/exp/joiner-epoch-99-avg-1.onnx \
|
||||||
|
--tokens $repo/data/lang_bpe_2000/tokens.txt \
|
||||||
|
$repo/test_wavs/DEV_T0000000000.wav \
|
||||||
|
$repo/test_wavs/DEV_T0000000001.wav \
|
||||||
|
$repo/test_wavs/DEV_T0000000002.wav \
|
||||||
|
$repo/test_wavs/TEST_MEETING_T0000000113.wav \
|
||||||
|
$repo/test_wavs/TEST_MEETING_T0000000219.wav \
|
||||||
|
$repo/test_wavs/TEST_MEETING_T0000000351.wav
|
||||||
|
|
||||||
|
rm -rf $repo
|
||||||
|
|
||||||
|
repo_url=https://huggingface.co/zrjin/icefall-asr-multi-zh-hans-zipformer-ctc-streaming-2023-11-05
|
||||||
|
log "Downloading pre-trained model from $repo_url"
|
||||||
|
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
|
||||||
|
pushd $repo
|
||||||
|
cd exp/
|
||||||
|
git lfs pull --include pretrained.pt
|
||||||
|
rm -fv epoch-20.pt
|
||||||
|
rm -fv *.onnx
|
||||||
|
ln -s pretrained.pt epoch-20.pt
|
||||||
|
cd ../data/lang_bpe_2000
|
||||||
|
ls -lh
|
||||||
|
git lfs pull --include L.pt L_disambig.pt Linv.pt bpe.model
|
||||||
|
git lfs pull --include "*.model"
|
||||||
|
ls -lh
|
||||||
|
popd
|
||||||
|
|
||||||
|
log "----------------------------------------"
|
||||||
|
log "Export streaming ONNX CTC models "
|
||||||
|
log "----------------------------------------"
|
||||||
|
./zipformer/export-onnx-streaming-ctc.py \
|
||||||
|
--exp-dir $repo/exp \
|
||||||
|
--tokens $repo/data/lang_bpe_2000/tokens.txt \
|
||||||
|
--causal 1 \
|
||||||
|
--avg 1 \
|
||||||
|
--epoch 20 \
|
||||||
|
--use-averaged-model 0 \
|
||||||
|
--chunk-size 16 \
|
||||||
|
--left-context-frames 128 \
|
||||||
|
--use-ctc 1
|
||||||
|
|
||||||
|
ls -lh $repo/exp/
|
||||||
|
|
||||||
|
log "------------------------------------------------------------"
|
||||||
|
log "Test exported streaming ONNX CTC models (greedy search) "
|
||||||
|
log "------------------------------------------------------------"
|
||||||
|
|
||||||
|
test_wavs=(
|
||||||
|
DEV_T0000000000.wav
|
||||||
|
DEV_T0000000001.wav
|
||||||
|
DEV_T0000000002.wav
|
||||||
|
TEST_MEETING_T0000000113.wav
|
||||||
|
TEST_MEETING_T0000000219.wav
|
||||||
|
TEST_MEETING_T0000000351.wav
|
||||||
|
)
|
||||||
|
|
||||||
|
for w in ${test_wavs[@]}; do
|
||||||
|
./zipformer/onnx_pretrained-streaming-ctc.py \
|
||||||
|
--model-filename $repo/exp/ctc-epoch-20-avg-1-chunk-16-left-128.int8.onnx \
|
||||||
|
--tokens $repo/data/lang_bpe_2000/tokens.txt \
|
||||||
|
$repo/test_wavs/$w
|
||||||
|
done
|
||||||
|
|
||||||
|
log "Upload onnx CTC models to huggingface"
|
||||||
|
url=https://huggingface.co/k2-fsa/sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13
|
||||||
|
GIT_LFS_SKIP_SMUDGE=1 git clone $url
|
||||||
|
dst=$(basename $url)
|
||||||
|
cp -v $repo/exp/ctc*.onnx $dst
|
||||||
|
cp -v $repo/data/lang_bpe_2000/tokens.txt $dst
|
||||||
|
cp -v $repo/data/lang_bpe_2000/bpe.model $dst
|
||||||
|
mkdir -p $dst/test_wavs
|
||||||
|
cp -v $repo/test_wavs/*.wav $dst/test_wavs
|
||||||
|
cd $dst
|
||||||
|
git lfs track "*.onnx" "bpe.model"
|
||||||
|
ls -lh
|
||||||
|
file bpe.model
|
||||||
|
git status
|
||||||
|
git add .
|
||||||
|
git commit -m "upload model" && git push https://k2-fsa:${HF_TOKEN}@huggingface.co/k2-fsa/$dst main || true
|
||||||
|
|
||||||
|
log "Upload models to https://github.com/k2-fsa/sherpa-onnx"
|
||||||
|
rm -rf .git
|
||||||
|
rm -fv .gitattributes
|
||||||
|
cd ..
|
||||||
|
tar cjfv $dst.tar.bz2 $dst
|
||||||
|
ls -lh *.tar.bz2
|
||||||
|
mv -v $dst.tar.bz2 ../../../
|
||||||
|
|
||||||
|
log "----------------------------------------"
|
||||||
|
log "Export streaming ONNX transducer models "
|
||||||
|
log "----------------------------------------"
|
||||||
|
|
||||||
|
./zipformer/export-onnx-streaming.py \
|
||||||
|
--exp-dir $repo/exp \
|
||||||
|
--tokens $repo/data/lang_bpe_2000/tokens.txt \
|
||||||
|
--causal 1 \
|
||||||
|
--avg 1 \
|
||||||
|
--epoch 20 \
|
||||||
|
--use-averaged-model 0 \
|
||||||
|
--chunk-size 16 \
|
||||||
|
--left-context-frames 128 \
|
||||||
|
--use-ctc 0
|
||||||
|
|
||||||
|
ls -lh $repo/exp
|
||||||
|
|
||||||
|
log "------------------------------------------------------------"
|
||||||
|
log "Test exported streaming ONNX transducer models (Python code)"
|
||||||
|
log "------------------------------------------------------------"
|
||||||
|
|
||||||
|
log "test fp32"
|
||||||
|
./zipformer/onnx_pretrained-streaming.py \
|
||||||
|
--encoder-model-filename $repo/exp/encoder-epoch-20-avg-1-chunk-16-left-128.onnx \
|
||||||
|
--decoder-model-filename $repo/exp/decoder-epoch-20-avg-1-chunk-16-left-128.onnx \
|
||||||
|
--joiner-model-filename $repo/exp/joiner-epoch-20-avg-1-chunk-16-left-128.onnx \
|
||||||
|
--tokens $repo/data/lang_bpe_2000/tokens.txt \
|
||||||
|
$repo/test_wavs/DEV_T0000000000.wav
|
||||||
|
|
||||||
|
log "test int8"
|
||||||
|
./zipformer/onnx_pretrained-streaming.py \
|
||||||
|
--encoder-model-filename $repo/exp/encoder-epoch-20-avg-1-chunk-16-left-128.int8.onnx \
|
||||||
|
--decoder-model-filename $repo/exp/decoder-epoch-20-avg-1-chunk-16-left-128.onnx \
|
||||||
|
--joiner-model-filename $repo/exp/joiner-epoch-20-avg-1-chunk-16-left-128.int8.onnx \
|
||||||
|
--tokens $repo/data/lang_bpe_2000/tokens.txt \
|
||||||
|
$repo/test_wavs/DEV_T0000000000.wav
|
||||||
|
|
||||||
|
log "Upload onnx transducer models to huggingface"
|
||||||
|
|
||||||
|
url=https://huggingface.co/k2-fsa/sherpa-onnx-streaming-zipformer-multi-zh-hans-2023-12-12
|
||||||
|
GIT_LFS_SKIP_SMUDGE=1 git clone $url
|
||||||
|
dst=$(basename $url)
|
||||||
|
cp -v $repo/exp/encoder*.onnx $dst
|
||||||
|
cp -v $repo/exp/decoder*.onnx $dst
|
||||||
|
cp -v $repo/exp/joiner*.onnx $dst
|
||||||
|
cp -v $repo/data/lang_bpe_2000/tokens.txt $dst
|
||||||
|
cp -v $repo/data/lang_bpe_2000/bpe.model $dst
|
||||||
|
mkdir -p $dst/test_wavs
|
||||||
|
cp -v $repo/test_wavs/*.wav $dst/test_wavs
|
||||||
|
cd $dst
|
||||||
|
git lfs track "*.onnx" bpe.model
|
||||||
|
git add .
|
||||||
|
git commit -m "upload model" && git push https://k2-fsa:${HF_TOKEN}@huggingface.co/k2-fsa/$dst main || true
|
||||||
|
|
||||||
|
log "Upload models to https://github.com/k2-fsa/sherpa-onnx"
|
||||||
|
rm -rf .git
|
||||||
|
rm -fv .gitattributes
|
||||||
|
cd ..
|
||||||
|
tar cjfv $dst.tar.bz2 $dst
|
||||||
|
ls -lh *.tar.bz2
|
||||||
|
mv -v $dst.tar.bz2 ../../../
|
||||||
@ -1,87 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/aishell/ASR
|
|
||||||
|
|
||||||
git lfs install
|
|
||||||
|
|
||||||
fbank_url=https://huggingface.co/csukuangfj/aishell-test-dev-manifests
|
|
||||||
log "Downloading pre-commputed fbank from $fbank_url"
|
|
||||||
|
|
||||||
git clone https://huggingface.co/csukuangfj/aishell-test-dev-manifests
|
|
||||||
ln -s $PWD/aishell-test-dev-manifests/data .
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-aishell-pruned-transducer-stateless3-2022-06-20
|
|
||||||
git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
ln -s pretrained-epoch-29-avg-5-torch-1.10.0.pt pretrained.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless3/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--lang-dir $repo/data/lang_char \
|
|
||||||
$repo/test_wavs/BAC009S0764W0121.wav \
|
|
||||||
$repo/test_wavs/BAC009S0764W0122.wav \
|
|
||||||
$repo/test_wavs/BAC009S0764W0123.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless3/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--lang-dir $repo/data/lang_char \
|
|
||||||
$repo/test_wavs/BAC009S0764W0121.wav \
|
|
||||||
$repo/test_wavs/BAC009S0764W0122.wav \
|
|
||||||
$repo/test_wavs/BAC009S0764W0123.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p pruned_transducer_stateless3/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt pruned_transducer_stateless3/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_char data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh pruned_transducer_stateless3/exp
|
|
||||||
|
|
||||||
log "Decoding test and dev"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless3/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir pruned_transducer_stateless3/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm pruned_transducer_stateless3/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -29,8 +29,8 @@ if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" ==
|
|||||||
ls -lh data/fbank
|
ls -lh data/fbank
|
||||||
ls -lh pruned_transducer_stateless2/exp
|
ls -lh pruned_transducer_stateless2/exp
|
||||||
|
|
||||||
ln -s data/fbank/cuts_DEV.jsonl.gz data/fbank/gigaspeech_cuts_DEV.jsonl.gz
|
ln -sf data/fbank/cuts_DEV.jsonl.gz data/fbank/gigaspeech_cuts_DEV.jsonl.gz
|
||||||
ln -s data/fbank/cuts_TEST.jsonl.gz data/fbank/gigaspeech_cuts_TEST.jsonl.gz
|
ln -sf data/fbank/cuts_TEST.jsonl.gz data/fbank/gigaspeech_cuts_TEST.jsonl.gz
|
||||||
|
|
||||||
log "Decoding dev and test"
|
log "Decoding dev and test"
|
||||||
|
|
||||||
|
|||||||
158
.github/scripts/run-gigaspeech-zipformer-2023-10-17.sh
vendored
Executable file
158
.github/scripts/run-gigaspeech-zipformer-2023-10-17.sh
vendored
Executable file
@ -0,0 +1,158 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
log() {
|
||||||
|
# This function is from espnet
|
||||||
|
local fname=${BASH_SOURCE[1]##*/}
|
||||||
|
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
cd egs/gigaspeech/ASR
|
||||||
|
|
||||||
|
repo_url=https://huggingface.co/yfyeung/icefall-asr-gigaspeech-zipformer-2023-10-17
|
||||||
|
|
||||||
|
log "Downloading pre-trained model from $repo_url"
|
||||||
|
git lfs install
|
||||||
|
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
|
||||||
|
log "Display test files"
|
||||||
|
tree $repo/
|
||||||
|
ls -lh $repo/test_wavs/*.wav
|
||||||
|
|
||||||
|
pushd $repo/exp
|
||||||
|
git lfs pull --include "data/lang_bpe_500/bpe.model"
|
||||||
|
git lfs pull --include "data/lang_bpe_500/tokens.txt"
|
||||||
|
git lfs pull --include "exp/jit_script.pt"
|
||||||
|
git lfs pull --include "exp/pretrained.pt"
|
||||||
|
rm epoch-30.pt
|
||||||
|
ln -s pretrained.pt epoch-30.pt
|
||||||
|
rm *.onnx
|
||||||
|
ls -lh
|
||||||
|
popd
|
||||||
|
|
||||||
|
log "----------------------------------------"
|
||||||
|
log "Export ONNX transducer models "
|
||||||
|
log "----------------------------------------"
|
||||||
|
|
||||||
|
./zipformer/export-onnx.py \
|
||||||
|
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
||||||
|
--use-averaged-model 0 \
|
||||||
|
--epoch 30 \
|
||||||
|
--avg 1 \
|
||||||
|
--exp-dir $repo/exp
|
||||||
|
|
||||||
|
ls -lh $repo/exp
|
||||||
|
|
||||||
|
log "------------------------------------------------------------"
|
||||||
|
log "Test exported ONNX transducer models (Python code) "
|
||||||
|
log "------------------------------------------------------------"
|
||||||
|
|
||||||
|
log "test fp32"
|
||||||
|
./zipformer/onnx_pretrained.py \
|
||||||
|
--encoder-model-filename $repo/exp/encoder-epoch-30-avg-1.onnx \
|
||||||
|
--decoder-model-filename $repo/exp/decoder-epoch-30-avg-1.onnx \
|
||||||
|
--joiner-model-filename $repo/exp/joiner-epoch-30-avg-1.onnx \
|
||||||
|
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
||||||
|
$repo/test_wavs/1089-134686-0001.wav \
|
||||||
|
$repo/test_wavs/1221-135766-0001.wav \
|
||||||
|
$repo/test_wavs/1221-135766-0002.wav
|
||||||
|
|
||||||
|
log "test int8"
|
||||||
|
./zipformer/onnx_pretrained.py \
|
||||||
|
--encoder-model-filename $repo/exp/encoder-epoch-30-avg-1.int8.onnx \
|
||||||
|
--decoder-model-filename $repo/exp/decoder-epoch-30-avg-1.onnx \
|
||||||
|
--joiner-model-filename $repo/exp/joiner-epoch-30-avg-1.int8.onnx \
|
||||||
|
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
||||||
|
$repo/test_wavs/1089-134686-0001.wav \
|
||||||
|
$repo/test_wavs/1221-135766-0001.wav \
|
||||||
|
$repo/test_wavs/1221-135766-0002.wav
|
||||||
|
|
||||||
|
log "Upload models to huggingface"
|
||||||
|
git config --global user.name "k2-fsa"
|
||||||
|
git config --global user.email "xxx@gmail.com"
|
||||||
|
|
||||||
|
url=https://huggingface.co/k2-fsa/sherpa-onnx-zipformer-gigaspeech-2023-12-12
|
||||||
|
GIT_LFS_SKIP_SMUDGE=1 git clone $url
|
||||||
|
dst=$(basename $url)
|
||||||
|
cp -v $repo/exp/*.onnx $dst
|
||||||
|
cp -v $repo/data/lang_bpe_500/tokens.txt $dst
|
||||||
|
cp -v $repo/data/lang_bpe_500/bpe.model $dst
|
||||||
|
mkdir -p $dst/test_wavs
|
||||||
|
cp -v $repo/test_wavs/*.wav $dst/test_wavs
|
||||||
|
cd $dst
|
||||||
|
git lfs track "*.onnx"
|
||||||
|
git add .
|
||||||
|
git commit -m "upload model" && git push https://k2-fsa:${HF_TOKEN}@huggingface.co/k2-fsa/$dst main || true
|
||||||
|
|
||||||
|
log "Upload models to https://github.com/k2-fsa/sherpa-onnx"
|
||||||
|
rm -rf .git
|
||||||
|
rm -fv .gitattributes
|
||||||
|
cd ..
|
||||||
|
tar cjfv $dst.tar.bz2 $dst
|
||||||
|
ls -lh
|
||||||
|
mv -v $dst.tar.bz2 ../../../
|
||||||
|
|
||||||
|
log "Export to torchscript model"
|
||||||
|
./zipformer/export.py \
|
||||||
|
--exp-dir $repo/exp \
|
||||||
|
--use-averaged-model false \
|
||||||
|
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
||||||
|
--epoch 30 \
|
||||||
|
--avg 1 \
|
||||||
|
--jit 1
|
||||||
|
|
||||||
|
ls -lh $repo/exp/*.pt
|
||||||
|
|
||||||
|
log "Decode with models exported by torch.jit.script()"
|
||||||
|
|
||||||
|
./zipformer/jit_pretrained.py \
|
||||||
|
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
||||||
|
--nn-model-filename $repo/exp/jit_script.pt \
|
||||||
|
$repo/test_wavs/1089-134686-0001.wav \
|
||||||
|
$repo/test_wavs/1221-135766-0001.wav \
|
||||||
|
$repo/test_wavs/1221-135766-0002.wav
|
||||||
|
|
||||||
|
for method in greedy_search modified_beam_search fast_beam_search; do
|
||||||
|
log "$method"
|
||||||
|
|
||||||
|
./zipformer/pretrained.py \
|
||||||
|
--method $method \
|
||||||
|
--beam-size 4 \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
||||||
|
$repo/test_wavs/1089-134686-0001.wav \
|
||||||
|
$repo/test_wavs/1221-135766-0001.wav \
|
||||||
|
$repo/test_wavs/1221-135766-0002.wav
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
||||||
|
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
||||||
|
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
||||||
|
mkdir -p zipformer/exp
|
||||||
|
ln -s $PWD/$repo/exp/pretrained.pt zipformer/exp/epoch-30.pt
|
||||||
|
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
||||||
|
|
||||||
|
ls -lh data
|
||||||
|
ls -lh zipformer/exp
|
||||||
|
|
||||||
|
log "Decoding test-clean and test-other"
|
||||||
|
|
||||||
|
# use a small value for decoding with CPU
|
||||||
|
max_duration=100
|
||||||
|
|
||||||
|
for method in greedy_search fast_beam_search modified_beam_search; do
|
||||||
|
log "Decoding with $method"
|
||||||
|
|
||||||
|
./zipformer/decode.py \
|
||||||
|
--decoding-method $method \
|
||||||
|
--epoch 30 \
|
||||||
|
--avg 1 \
|
||||||
|
--use-averaged-model 0 \
|
||||||
|
--max-duration $max_duration \
|
||||||
|
--exp-dir zipformer/exp
|
||||||
|
done
|
||||||
|
|
||||||
|
rm zipformer/exp/*.pt
|
||||||
|
fi
|
||||||
@ -1,122 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/Zengwei/icefall-asr-librispeech-conformer-ctc3-2022-11-27
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
git lfs pull --include "data/lang_bpe_500/HLG.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/L.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/LG.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/Linv.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/bpe.model"
|
|
||||||
git lfs pull --include "data/lm/G_4_gram.pt"
|
|
||||||
git lfs pull --include "exp/jit_trace.pt"
|
|
||||||
git lfs pull --include "exp/pretrained.pt"
|
|
||||||
ln -s pretrained.pt epoch-99.pt
|
|
||||||
ls -lh *.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.trace()"
|
|
||||||
|
|
||||||
for m in ctc-decoding 1best; do
|
|
||||||
./conformer_ctc3/jit_pretrained.py \
|
|
||||||
--model-filename $repo/exp/jit_trace.pt \
|
|
||||||
--words-file $repo/data/lang_bpe_500/words.txt \
|
|
||||||
--HLG $repo/data/lang_bpe_500/HLG.pt \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--G $repo/data/lm/G_4_gram.pt \
|
|
||||||
--method $m \
|
|
||||||
--sample-rate 16000 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
log "Export to torchscript model"
|
|
||||||
|
|
||||||
./conformer_ctc3/export.py \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--jit-trace 1 \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1 \
|
|
||||||
--use-averaged-model 0
|
|
||||||
|
|
||||||
ls -lh $repo/exp/*.pt
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.trace()"
|
|
||||||
|
|
||||||
for m in ctc-decoding 1best; do
|
|
||||||
./conformer_ctc3/jit_pretrained.py \
|
|
||||||
--model-filename $repo/exp/jit_trace.pt \
|
|
||||||
--words-file $repo/data/lang_bpe_500/words.txt \
|
|
||||||
--HLG $repo/data/lang_bpe_500/HLG.pt \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--G $repo/data/lm/G_4_gram.pt \
|
|
||||||
--method $m \
|
|
||||||
--sample-rate 16000 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for m in ctc-decoding 1best; do
|
|
||||||
./conformer_ctc3/pretrained.py \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--words-file $repo/data/lang_bpe_500/words.txt \
|
|
||||||
--HLG $repo/data/lang_bpe_500/HLG.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--G $repo/data/lm/G_4_gram.pt \
|
|
||||||
--method $m \
|
|
||||||
--sample-rate 16000 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p conformer_ctc3/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt conformer_ctc3/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh conformer_ctc3/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in ctc-decoding 1best; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
./conformer_ctc3/decode.py \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--exp-dir conformer_ctc3/exp/ \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--decoding-method $method \
|
|
||||||
--lm-dir data/lm
|
|
||||||
done
|
|
||||||
|
|
||||||
rm conformer_ctc3/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless-2022-03-12
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in fast_beam_search modified_beam_search beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p pruned_transducer_stateless/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt pruned_transducer_stateless/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh pruned_transducer_stateless/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir pruned_transducer_stateless/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm pruned_transducer_stateless/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless2-2022-04-29
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
pushd $repo
|
|
||||||
git lfs pull --include "data/lang_bpe_500/bpe.model"
|
|
||||||
git lfs pull --include "exp/pretrained-epoch-38-avg-10.pt"
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
ln -s pretrained-epoch-38-avg-10.pt pretrained.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless2/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless2/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p pruned_transducer_stateless2/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt pruned_transducer_stateless2/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh pruned_transducer_stateless2/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless2/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir pruned_transducer_stateless2/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm pruned_transducer_stateless2/exp/*.pt
|
|
||||||
rm -r data/lang_bpe_500
|
|
||||||
fi
|
|
||||||
@ -1,85 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless3-2022-04-29
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
pushd $repo
|
|
||||||
git lfs pull --include "data/lang_bpe_500/bpe.model"
|
|
||||||
git lfs pull --include "exp/pretrained-epoch-25-avg-6.pt"
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
ln -s pretrained-epoch-25-avg-6.pt pretrained.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless3/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless3/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p pruned_transducer_stateless3/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt pruned_transducer_stateless3/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh pruned_transducer_stateless3/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless3/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir pruned_transducer_stateless3/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm pruned_transducer_stateless3/exp/*.pt
|
|
||||||
rm -r data/lang_bpe_500
|
|
||||||
fi
|
|
||||||
@ -1,123 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
ln -s pretrained-iter-1224000-avg-14.pt pretrained.pt
|
|
||||||
ln -s pretrained-iter-1224000-avg-14.pt epoch-99.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
|
|
||||||
log "Export to torchscript model"
|
|
||||||
./pruned_transducer_stateless3/export.py \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1 \
|
|
||||||
--jit 1
|
|
||||||
|
|
||||||
./pruned_transducer_stateless3/export.py \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1 \
|
|
||||||
--jit-trace 1
|
|
||||||
|
|
||||||
ls -lh $repo/exp/*.pt
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.trace()"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless3/jit_pretrained.py \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--encoder-model-filename $repo/exp/encoder_jit_trace.pt \
|
|
||||||
--decoder-model-filename $repo/exp/decoder_jit_trace.pt \
|
|
||||||
--joiner-model-filename $repo/exp/joiner_jit_trace.pt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.script()"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless3/jit_pretrained.py \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--encoder-model-filename $repo/exp/encoder_jit_script.pt \
|
|
||||||
--decoder-model-filename $repo/exp/decoder_jit_script.pt \
|
|
||||||
--joiner-model-filename $repo/exp/joiner_jit_script.pt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless3/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless3/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p pruned_transducer_stateless3/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt pruned_transducer_stateless3/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh pruned_transducer_stateless3/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless3/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir pruned_transducer_stateless3/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm pruned_transducer_stateless3/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,100 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless5-2022-05-13
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
ln -s pretrained-epoch-39-avg-7.pt pretrained.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless5/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--num-encoder-layers 18 \
|
|
||||||
--dim-feedforward 2048 \
|
|
||||||
--nhead 8 \
|
|
||||||
--encoder-dim 512 \
|
|
||||||
--decoder-dim 512 \
|
|
||||||
--joiner-dim 512 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless5/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav \
|
|
||||||
--num-encoder-layers 18 \
|
|
||||||
--dim-feedforward 2048 \
|
|
||||||
--nhead 8 \
|
|
||||||
--encoder-dim 512 \
|
|
||||||
--decoder-dim 512 \
|
|
||||||
--joiner-dim 512
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p pruned_transducer_stateless5/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained-epoch-39-avg-7.pt pruned_transducer_stateless5/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh pruned_transducer_stateless5/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless5/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir pruned_transducer_stateless5/exp \
|
|
||||||
--num-encoder-layers 18 \
|
|
||||||
--dim-feedforward 2048 \
|
|
||||||
--nhead 8 \
|
|
||||||
--encoder-dim 512 \
|
|
||||||
--decoder-dim 512 \
|
|
||||||
--joiner-dim 512
|
|
||||||
done
|
|
||||||
|
|
||||||
rm pruned_transducer_stateless5/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,106 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless7-2022-11-11
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
git lfs pull --include "data/lang_bpe_500/bpe.model"
|
|
||||||
git lfs pull --include "exp/cpu_jit.pt"
|
|
||||||
git lfs pull --include "exp/pretrained.pt"
|
|
||||||
ln -s pretrained.pt epoch-99.pt
|
|
||||||
ls -lh *.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Export to torchscript model"
|
|
||||||
./pruned_transducer_stateless7/export.py \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--use-averaged-model false \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1 \
|
|
||||||
--jit 1
|
|
||||||
|
|
||||||
ls -lh $repo/exp/*.pt
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.script()"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7/jit_pretrained.py \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--nn-model-filename $repo/exp/cpu_jit.pt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p pruned_transducer_stateless7/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt pruned_transducer_stateless7/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh pruned_transducer_stateless7/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir pruned_transducer_stateless7/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm pruned_transducer_stateless7/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,150 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/Zengwei/icefall-asr-librispeech-pruned-transducer-stateless7-ctc-2022-12-01
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
git lfs pull --include "data/lang_bpe_500/HLG.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/L.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/LG.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/Linv.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/bpe.model"
|
|
||||||
git lfs pull --include "data/lm/G_4_gram.pt"
|
|
||||||
git lfs pull --include "exp/cpu_jit.pt"
|
|
||||||
git lfs pull --include "exp/pretrained.pt"
|
|
||||||
ln -s pretrained.pt epoch-99.pt
|
|
||||||
ls -lh *.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Export to torchscript model"
|
|
||||||
./pruned_transducer_stateless7_ctc/export.py \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--use-averaged-model false \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1 \
|
|
||||||
--jit 1
|
|
||||||
|
|
||||||
ls -lh $repo/exp/*.pt
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.script()"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7_ctc/jit_pretrained.py \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--nn-model-filename $repo/exp/cpu_jit.pt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
for m in ctc-decoding 1best; do
|
|
||||||
./pruned_transducer_stateless7_ctc/jit_pretrained_ctc.py \
|
|
||||||
--model-filename $repo/exp/cpu_jit.pt \
|
|
||||||
--words-file $repo/data/lang_bpe_500/words.txt \
|
|
||||||
--HLG $repo/data/lang_bpe_500/HLG.pt \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--G $repo/data/lm/G_4_gram.pt \
|
|
||||||
--method $m \
|
|
||||||
--sample-rate 16000 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7_ctc/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7_ctc/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for m in ctc-decoding 1best; do
|
|
||||||
./pruned_transducer_stateless7_ctc/pretrained_ctc.py \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--words-file $repo/data/lang_bpe_500/words.txt \
|
|
||||||
--HLG $repo/data/lang_bpe_500/HLG.pt \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--G $repo/data/lm/G_4_gram.pt \
|
|
||||||
--method $m \
|
|
||||||
--sample-rate 16000 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p pruned_transducer_stateless7_ctc/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt pruned_transducer_stateless7_ctc/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh pruned_transducer_stateless7_ctc/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7_ctc/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir pruned_transducer_stateless7_ctc/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
for m in ctc-decoding 1best; do
|
|
||||||
./pruned_transducer_stateless7_ctc/ctc_decode.py \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--exp-dir ./pruned_transducer_stateless7_ctc/exp \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--decoding-method $m \
|
|
||||||
--hlg-scale 0.6 \
|
|
||||||
--lm-dir data/lm
|
|
||||||
done
|
|
||||||
|
|
||||||
rm pruned_transducer_stateless7_ctc/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,147 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/yfyeung/icefall-asr-librispeech-pruned_transducer_stateless7_ctc_bs-2023-01-29
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
git lfs pull --include "data/lang_bpe_500/L.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/LG.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/HLG.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/Linv.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/bpe.model"
|
|
||||||
git lfs pull --include "exp/cpu_jit.pt"
|
|
||||||
git lfs pull --include "exp/pretrained.pt"
|
|
||||||
ln -s pretrained.pt epoch-99.pt
|
|
||||||
ls -lh *.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Export to torchscript model"
|
|
||||||
./pruned_transducer_stateless7_ctc_bs/export.py \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--use-averaged-model false \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1 \
|
|
||||||
--jit 1
|
|
||||||
|
|
||||||
ls -lh $repo/exp/*.pt
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.script()"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7_ctc_bs/jit_pretrained.py \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--nn-model-filename $repo/exp/cpu_jit.pt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
for m in ctc-decoding 1best; do
|
|
||||||
./pruned_transducer_stateless7_ctc_bs/jit_pretrained_ctc.py \
|
|
||||||
--model-filename $repo/exp/cpu_jit.pt \
|
|
||||||
--words-file $repo/data/lang_bpe_500/words.txt \
|
|
||||||
--HLG $repo/data/lang_bpe_500/HLG.pt \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--method $m \
|
|
||||||
--sample-rate 16000 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7_ctc_bs/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7_ctc_bs/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for m in ctc-decoding 1best; do
|
|
||||||
./pruned_transducer_stateless7_ctc_bs/pretrained_ctc.py \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--words-file $repo/data/lang_bpe_500/words.txt \
|
|
||||||
--HLG $repo/data/lang_bpe_500/HLG.pt \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--method $m \
|
|
||||||
--sample-rate 16000 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p pruned_transducer_stateless7_ctc_bs/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt pruned_transducer_stateless7_ctc_bs/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh pruned_transducer_stateless7_ctc_bs/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7_ctc_bs/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir pruned_transducer_stateless7_ctc_bs/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
for m in ctc-decoding 1best; do
|
|
||||||
./pruned_transducer_stateless7_ctc_bs/ctc_decode.py \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--exp-dir ./pruned_transducer_stateless7_ctc_bs/exp \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--decoding-method $m \
|
|
||||||
--hlg-scale 0.6
|
|
||||||
done
|
|
||||||
|
|
||||||
rm pruned_transducer_stateless7_ctc_bs/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,148 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/Zengwei/icefall-asr-librispeech-pruned-transducer-stateless7-streaming-2022-12-29
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo
|
|
||||||
git lfs pull --include "data/lang_bpe_500/bpe.model"
|
|
||||||
git lfs pull --include "exp/cpu_jit.pt"
|
|
||||||
git lfs pull --include "exp/pretrained.pt"
|
|
||||||
git lfs pull --include "exp/encoder_jit_trace.pt"
|
|
||||||
git lfs pull --include "exp/decoder_jit_trace.pt"
|
|
||||||
git lfs pull --include "exp/joiner_jit_trace.pt"
|
|
||||||
cd exp
|
|
||||||
ln -s pretrained.pt epoch-99.pt
|
|
||||||
ls -lh *.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Export to torchscript model"
|
|
||||||
./pruned_transducer_stateless7_streaming/export.py \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--use-averaged-model false \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--decode-chunk-len 32 \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1 \
|
|
||||||
--jit 1
|
|
||||||
|
|
||||||
ls -lh $repo/exp/*.pt
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.script()"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7_streaming/jit_pretrained.py \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--nn-model-filename $repo/exp/cpu_jit.pt \
|
|
||||||
--decode-chunk-len 32 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
log "Export to torchscript model by torch.jit.trace()"
|
|
||||||
./pruned_transducer_stateless7_streaming/jit_trace_export.py \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--use-averaged-model false \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--decode-chunk-len 32 \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.trace()"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7_streaming/jit_trace_pretrained.py \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--encoder-model-filename $repo/exp/encoder_jit_trace.pt \
|
|
||||||
--decoder-model-filename $repo/exp/decoder_jit_trace.pt \
|
|
||||||
--joiner-model-filename $repo/exp/joiner_jit_trace.pt \
|
|
||||||
--decode-chunk-len 32 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7_streaming/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--decode-chunk-len 32 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7_streaming/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--decode-chunk-len 32 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p pruned_transducer_stateless7_streaming/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt pruned_transducer_stateless7_streaming/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh pruned_transducer_stateless7_streaming/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
num_decode_stream=200
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "decoding with $method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7_streaming/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--decode-chunk-len 32 \
|
|
||||||
--exp-dir pruned_transducer_stateless7_streaming/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless7_streaming/streaming_decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--decode-chunk-len 32 \
|
|
||||||
--num-decode-streams $num_decode_stream
|
|
||||||
--exp-dir pruned_transducer_stateless7_streaming/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm pruned_transducer_stateless7_streaming/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,115 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless8-2022-11-14
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
git lfs pull --include "data/lang_bpe_500/bpe.model"
|
|
||||||
git lfs pull --include "exp/cpu_jit.pt"
|
|
||||||
git lfs pull --include "exp/pretrained.pt"
|
|
||||||
ln -s pretrained.pt epoch-99.pt
|
|
||||||
ls -lh *.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.script()"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless8/jit_pretrained.py \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--nn-model-filename $repo/exp/cpu_jit.pt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
log "Export to torchscript model"
|
|
||||||
./pruned_transducer_stateless8/export.py \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--use-averaged-model false \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1 \
|
|
||||||
--jit 1
|
|
||||||
|
|
||||||
ls -lh $repo/exp/*.pt
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.script()"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless8/jit_pretrained.py \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--nn-model-filename $repo/exp/cpu_jit.pt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless8/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless8/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p pruned_transducer_stateless8/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt pruned_transducer_stateless8/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh pruned_transducer_stateless8/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless8/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir pruned_transducer_stateless8/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm pruned_transducer_stateless8/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,101 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/pkufool/icefall_librispeech_streaming_pruned_transducer_stateless2_20220625
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
ln -s pretrained-epoch-24-avg-10.pt pretrained.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless2/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--simulate-streaming 1 \
|
|
||||||
--causal-convolution 1 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless2/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--simulate-streaming 1 \
|
|
||||||
--causal-convolution 1 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p pruned_transducer_stateless2/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained-epoch-24-avg-10.pt pruned_transducer_stateless2/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh pruned_transducer_stateless2/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Simulate streaming decoding with $method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless2/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir pruned_transducer_stateless2/exp \
|
|
||||||
--simulate-streaming 1 \
|
|
||||||
--causal-convolution 1
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Real streaming decoding with $method"
|
|
||||||
|
|
||||||
./pruned_transducer_stateless2/streaming_decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--num-decode-streams 100 \
|
|
||||||
--exp-dir pruned_transducer_stateless2/exp \
|
|
||||||
--left-context 32 \
|
|
||||||
--decode-chunk-size 8 \
|
|
||||||
--right-context 0
|
|
||||||
done
|
|
||||||
|
|
||||||
rm pruned_transducer_stateless2/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,116 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/Zengwei/icefall-asr-librispeech-streaming-zipformer-2023-05-17
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
git lfs pull --include "data/lang_bpe_500/bpe.model"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/tokens.txt"
|
|
||||||
git lfs pull --include "exp/jit_script_chunk_16_left_128.pt"
|
|
||||||
git lfs pull --include "exp/pretrained.pt"
|
|
||||||
ln -s pretrained.pt epoch-99.pt
|
|
||||||
ls -lh *.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Export to torchscript model"
|
|
||||||
./zipformer/export.py \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--use-averaged-model false \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--causal 1 \
|
|
||||||
--chunk-size 16 \
|
|
||||||
--left-context-frames 128 \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1 \
|
|
||||||
--jit 1
|
|
||||||
|
|
||||||
ls -lh $repo/exp/*.pt
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.script()"
|
|
||||||
|
|
||||||
./zipformer/jit_pretrained_streaming.py \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--nn-model-filename $repo/exp/jit_script_chunk_16_left_128.pt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav
|
|
||||||
|
|
||||||
for method in greedy_search modified_beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./zipformer/pretrained.py \
|
|
||||||
--causal 1 \
|
|
||||||
--chunk-size 16 \
|
|
||||||
--left-context-frames 128 \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p zipformer/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt zipformer/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh zipformer/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Simulated streaming decoding with $method"
|
|
||||||
|
|
||||||
./zipformer/decode.py \
|
|
||||||
--causal 1 \
|
|
||||||
--chunk-size 16 \
|
|
||||||
--left-context-frames 128 \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir zipformer/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Chunk-wise streaming decoding with $method"
|
|
||||||
|
|
||||||
./zipformer/streaming_decode.py \
|
|
||||||
--causal 1 \
|
|
||||||
--chunk-size 16 \
|
|
||||||
--left-context-frames 128 \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir zipformer/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm zipformer/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-asr-librispeech-transducer-stateless2-torchaudio-2022-04-19
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./transducer_stateless2/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in fast_beam_search modified_beam_search beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./transducer_stateless2/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p transducer_stateless2/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt transducer_stateless2/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh transducer_stateless2/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./transducer_stateless2/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir transducer_stateless2/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm transducer_stateless2/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,94 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/Zengwei/icefall-asr-librispeech-zipformer-2023-05-15
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
git lfs pull --include "data/lang_bpe_500/bpe.model"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/tokens.txt"
|
|
||||||
git lfs pull --include "exp/jit_script.pt"
|
|
||||||
git lfs pull --include "exp/pretrained.pt"
|
|
||||||
ln -s pretrained.pt epoch-99.pt
|
|
||||||
ls -lh *.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Export to torchscript model"
|
|
||||||
./zipformer/export.py \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--use-averaged-model false \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1 \
|
|
||||||
--jit 1
|
|
||||||
|
|
||||||
ls -lh $repo/exp/*.pt
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.script()"
|
|
||||||
|
|
||||||
./zipformer/jit_pretrained.py \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--nn-model-filename $repo/exp/jit_script.pt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
for method in greedy_search modified_beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./zipformer/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p zipformer/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt zipformer/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh zipformer/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./zipformer/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir zipformer/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm zipformer/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,117 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/Zengwei/icefall-asr-librispeech-zipformer-transducer-ctc-2023-06-13
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
git lfs pull --include "data/lang_bpe_500/bpe.model"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/tokens.txt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/HLG.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/L.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/LG.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/Linv.pt"
|
|
||||||
git lfs pull --include "data/lm/G_4_gram.pt"
|
|
||||||
git lfs pull --include "exp/jit_script.pt"
|
|
||||||
git lfs pull --include "exp/pretrained.pt"
|
|
||||||
ln -s pretrained.pt epoch-99.pt
|
|
||||||
ls -lh *.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Export to torchscript model"
|
|
||||||
./zipformer/export.py \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--use-transducer 1 \
|
|
||||||
--use-ctc 1 \
|
|
||||||
--use-averaged-model false \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1 \
|
|
||||||
--jit 1
|
|
||||||
|
|
||||||
ls -lh $repo/exp/*.pt
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.script()"
|
|
||||||
|
|
||||||
for method in ctc-decoding 1best; do
|
|
||||||
./zipformer/jit_pretrained_ctc.py \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--model-filename $repo/exp/jit_script.pt \
|
|
||||||
--HLG $repo/data/lang_bpe_500/HLG.pt \
|
|
||||||
--words-file $repo/data/lang_bpe_500/words.txt \
|
|
||||||
--G $repo/data/lm/G_4_gram.pt \
|
|
||||||
--method $method \
|
|
||||||
--sample-rate 16000 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in ctc-decoding 1best; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./zipformer/pretrained_ctc.py \
|
|
||||||
--use-transducer 1 \
|
|
||||||
--use-ctc 1 \
|
|
||||||
--method $method \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--HLG $repo/data/lang_bpe_500/HLG.pt \
|
|
||||||
--G $repo/data/lm/G_4_gram.pt \
|
|
||||||
--words-file $repo/data/lang_bpe_500/words.txt \
|
|
||||||
--sample-rate 16000 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p zipformer/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt zipformer/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh zipformer/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in ctc-decoding 1best; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./zipformer/ctc_decode.py \
|
|
||||||
--use-transducer 1 \
|
|
||||||
--use-ctc 1 \
|
|
||||||
--decoding-method $method \
|
|
||||||
--nbest-scale 1.0 \
|
|
||||||
--hlg-scale 0.6 \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir zipformer/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm zipformer/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,102 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/Zengwei/icefall-asr-librispeech-zipformer-mmi-2022-12-08
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
git lfs pull --include "data/lang_bpe_500/3gram.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/4gram.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/L.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/LG.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/Linv.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/bpe.model"
|
|
||||||
git lfs pull --include "exp/cpu_jit.pt"
|
|
||||||
git lfs pull --include "exp/pretrained.pt"
|
|
||||||
ln -s pretrained.pt epoch-99.pt
|
|
||||||
ls -lh *.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Export to torchscript model"
|
|
||||||
./zipformer_mmi/export.py \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--use-averaged-model false \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1 \
|
|
||||||
--jit 1
|
|
||||||
|
|
||||||
ls -lh $repo/exp/*.pt
|
|
||||||
|
|
||||||
log "Decode with models exported by torch.jit.script()"
|
|
||||||
|
|
||||||
./zipformer_mmi/jit_pretrained.py \
|
|
||||||
--bpe-model $repo/data/lang_bpe_500/bpe.model \
|
|
||||||
--nn-model-filename $repo/exp/cpu_jit.pt \
|
|
||||||
--lang-dir $repo/data/lang_bpe_500 \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
for method in 1best nbest nbest-rescoring-LG nbest-rescoring-3-gram nbest-rescoring-4-gram; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./zipformer_mmi/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--lang-dir $repo/data/lang_bpe_500 \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p zipformer_mmi/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt zipformer_mmi/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh zipformer_mmi/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in 1best nbest nbest-rescoring-LG nbest-rescoring-3-gram nbest-rescoring-4-gram; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./zipformer_mmi/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--use-averaged-model 0 \
|
|
||||||
--nbest-scale 1.2 \
|
|
||||||
--hp-scale 1.0 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--lang-dir $repo/data/lang_bpe_500 \
|
|
||||||
--exp-dir zipformer_mmi/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm zipformer_mmi/exp/*.pt
|
|
||||||
fi
|
|
||||||
135
.github/scripts/run-multi-corpora-zipformer.sh
vendored
Executable file
135
.github/scripts/run-multi-corpora-zipformer.sh
vendored
Executable file
@ -0,0 +1,135 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
log() {
|
||||||
|
# This function is from espnet
|
||||||
|
local fname=${BASH_SOURCE[1]##*/}
|
||||||
|
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
cd egs/multi_zh-hans/ASR
|
||||||
|
|
||||||
|
log "==== Test icefall-asr-multi-zh-hans-zipformer-2023-9-2 ===="
|
||||||
|
repo_url=https://huggingface.co/zrjin/icefall-asr-multi-zh-hans-zipformer-2023-9-2/
|
||||||
|
|
||||||
|
log "Downloading pre-trained model from $repo_url"
|
||||||
|
git lfs install
|
||||||
|
git clone $repo_url
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
|
||||||
|
|
||||||
|
log "Display test files"
|
||||||
|
tree $repo/
|
||||||
|
ls -lh $repo/test_wavs/*.wav
|
||||||
|
|
||||||
|
pushd $repo/exp
|
||||||
|
ln -s epoch-20.pt epoch-99.pt
|
||||||
|
popd
|
||||||
|
|
||||||
|
ls -lh $repo/exp/*.pt
|
||||||
|
|
||||||
|
|
||||||
|
./zipformer/pretrained.py \
|
||||||
|
--checkpoint $repo/exp/epoch-99.pt \
|
||||||
|
--tokens $repo/data/lang_bpe_2000/tokens.txt \
|
||||||
|
--method greedy_search \
|
||||||
|
$repo/test_wavs/DEV_T0000000000.wav \
|
||||||
|
$repo/test_wavs/DEV_T0000000001.wav \
|
||||||
|
$repo/test_wavs/DEV_T0000000002.wav
|
||||||
|
|
||||||
|
for method in modified_beam_search fast_beam_search; do
|
||||||
|
log "$method"
|
||||||
|
|
||||||
|
./zipformer/pretrained.py \
|
||||||
|
--method $method \
|
||||||
|
--beam-size 4 \
|
||||||
|
--checkpoint $repo/exp/epoch-99.pt \
|
||||||
|
--tokens $repo/data/lang_bpe_2000/tokens.txt \
|
||||||
|
$repo/test_wavs/DEV_T0000000000.wav \
|
||||||
|
$repo/test_wavs/DEV_T0000000001.wav \
|
||||||
|
$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/
|
||||||
|
|
||||||
|
log "Downloading pre-trained model from $repo_url"
|
||||||
|
git lfs install
|
||||||
|
git clone $repo_url
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
|
||||||
|
|
||||||
|
log "Display test files"
|
||||||
|
tree $repo/
|
||||||
|
ls -lh $repo/test_wavs/*.wav
|
||||||
|
|
||||||
|
pushd $repo/exp
|
||||||
|
ln -s epoch-20.pt epoch-99.pt
|
||||||
|
popd
|
||||||
|
|
||||||
|
ls -lh $repo/exp/*.pt
|
||||||
|
|
||||||
|
|
||||||
|
./zipformer/pretrained.py \
|
||||||
|
--checkpoint $repo/exp/epoch-99.pt \
|
||||||
|
--tokens $repo/data/lang_bpe_2000/tokens.txt \
|
||||||
|
--use-ctc 1 \
|
||||||
|
--method greedy_search \
|
||||||
|
$repo/test_wavs/DEV_T0000000000.wav \
|
||||||
|
$repo/test_wavs/DEV_T0000000001.wav \
|
||||||
|
$repo/test_wavs/DEV_T0000000002.wav
|
||||||
|
|
||||||
|
for method in modified_beam_search fast_beam_search; do
|
||||||
|
log "$method"
|
||||||
|
|
||||||
|
./zipformer/pretrained.py \
|
||||||
|
--method $method \
|
||||||
|
--beam-size 4 \
|
||||||
|
--use-ctc 1 \
|
||||||
|
--checkpoint $repo/exp/epoch-99.pt \
|
||||||
|
--tokens $repo/data/lang_bpe_2000/tokens.txt \
|
||||||
|
$repo/test_wavs/DEV_T0000000000.wav \
|
||||||
|
$repo/test_wavs/DEV_T0000000001.wav \
|
||||||
|
$repo/test_wavs/DEV_T0000000002.wav
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -rf $repo
|
||||||
|
|
||||||
|
cd ../../../egs/multi_zh_en/ASR
|
||||||
|
log "==== Test icefall-asr-zipformer-multi-zh-en-2023-11-22 ===="
|
||||||
|
repo_url=https://huggingface.co/zrjin/icefall-asr-zipformer-multi-zh-en-2023-11-22/
|
||||||
|
|
||||||
|
log "Downloading pre-trained model from $repo_url"
|
||||||
|
git lfs install
|
||||||
|
git clone $repo_url
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
|
||||||
|
log "Display test files"
|
||||||
|
tree $repo/
|
||||||
|
ls -lh $repo/test_wavs/*.wav
|
||||||
|
|
||||||
|
./zipformer/pretrained.py \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--bpe-model $repo/data/lang_bbpe_2000/bbpe.model \
|
||||||
|
--method greedy_search \
|
||||||
|
$repo/test_wavs/_1634_210_2577_1_1525157964032_3712259_29.wav \
|
||||||
|
$repo/test_wavs/_1634_210_2577_1_1525157964032_3712259_55.wav \
|
||||||
|
$repo/test_wavs/_1634_210_2577_1_1525157964032_3712259_75.wav
|
||||||
|
|
||||||
|
for method in modified_beam_search fast_beam_search; do
|
||||||
|
log "$method"
|
||||||
|
|
||||||
|
./zipformer/pretrained.py \
|
||||||
|
--method $method \
|
||||||
|
--beam-size 4 \
|
||||||
|
--checkpoint $repo/exp/pretrained.pt \
|
||||||
|
--bpe-model $repo/data/lang_bbpe_2000/bbpe.model \
|
||||||
|
$repo/test_wavs/_1634_210_2577_1_1525157964032_3712259_29.wav \
|
||||||
|
$repo/test_wavs/_1634_210_2577_1_1525157964032_3712259_55.wav \
|
||||||
|
$repo/test_wavs/_1634_210_2577_1_1525157964032_3712259_75.wav
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -rf $repo
|
||||||
51
.github/scripts/run-multi-zh_hans-zipformer.sh
vendored
51
.github/scripts/run-multi-zh_hans-zipformer.sh
vendored
@ -1,51 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/multi_zh-hans/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/zrjin/icefall-asr-multi-zh-hans-zipformer-2023-9-2/
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
ln -s epoch-20.pt epoch-99.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
ls -lh $repo/exp/*.pt
|
|
||||||
|
|
||||||
|
|
||||||
./zipformer/pretrained.py \
|
|
||||||
--checkpoint $repo/exp/epoch-99.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_2000/tokens.txt \
|
|
||||||
--method greedy_search \
|
|
||||||
$repo/test_wavs/DEV_T0000000000.wav \
|
|
||||||
$repo/test_wavs/DEV_T0000000001.wav \
|
|
||||||
$repo/test_wavs/DEV_T0000000002.wav
|
|
||||||
|
|
||||||
for method in modified_beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./zipformer/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/epoch-99.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_2000/tokens.txt \
|
|
||||||
$repo/test_wavs/DEV_T0000000000.wav \
|
|
||||||
$repo/test_wavs/DEV_T0000000001.wav \
|
|
||||||
$repo/test_wavs/DEV_T0000000002.wav
|
|
||||||
done
|
|
||||||
240
.github/scripts/run-pre-trained-ctc.sh
vendored
240
.github/scripts/run-pre-trained-ctc.sh
vendored
@ -1,240 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
pushd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/sherpa-onnx-zipformer-ctc-en-2023-10-02
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
log "CTC greedy search"
|
|
||||||
|
|
||||||
./zipformer/onnx_pretrained_ctc.py \
|
|
||||||
--nn-model $repo/model.onnx \
|
|
||||||
--tokens $repo/tokens.txt \
|
|
||||||
$repo/test_wavs/0.wav \
|
|
||||||
$repo/test_wavs/1.wav \
|
|
||||||
$repo/test_wavs/2.wav
|
|
||||||
|
|
||||||
log "CTC H decoding"
|
|
||||||
|
|
||||||
./zipformer/onnx_pretrained_ctc_H.py \
|
|
||||||
--nn-model $repo/model.onnx \
|
|
||||||
--tokens $repo/tokens.txt \
|
|
||||||
--H $repo/H.fst \
|
|
||||||
$repo/test_wavs/0.wav \
|
|
||||||
$repo/test_wavs/1.wav \
|
|
||||||
$repo/test_wavs/2.wav
|
|
||||||
|
|
||||||
log "CTC HL decoding"
|
|
||||||
|
|
||||||
./zipformer/onnx_pretrained_ctc_HL.py \
|
|
||||||
--nn-model $repo/model.onnx \
|
|
||||||
--words $repo/words.txt \
|
|
||||||
--HL $repo/HL.fst \
|
|
||||||
$repo/test_wavs/0.wav \
|
|
||||||
$repo/test_wavs/1.wav \
|
|
||||||
$repo/test_wavs/2.wav
|
|
||||||
|
|
||||||
log "CTC HLG decoding"
|
|
||||||
|
|
||||||
./zipformer/onnx_pretrained_ctc_HLG.py \
|
|
||||||
--nn-model $repo/model.onnx \
|
|
||||||
--words $repo/words.txt \
|
|
||||||
--HLG $repo/HLG.fst \
|
|
||||||
$repo/test_wavs/0.wav \
|
|
||||||
$repo/test_wavs/1.wav \
|
|
||||||
$repo/test_wavs/2.wav
|
|
||||||
|
|
||||||
rm -rf $repo
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-asr-librispeech-conformer-ctc-jit-bpe-500-2021-11-09
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
pushd $repo
|
|
||||||
|
|
||||||
git lfs pull --include "exp/pretrained.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/HLG.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/L.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/L_disambig.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/Linv.pt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/bpe.model"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/lexicon.txt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/lexicon_disambig.txt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/tokens.txt"
|
|
||||||
git lfs pull --include "data/lang_bpe_500/words.txt"
|
|
||||||
git lfs pull --include "data/lm/G_3_gram.fst.txt"
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
log "CTC decoding"
|
|
||||||
|
|
||||||
./conformer_ctc/pretrained.py \
|
|
||||||
--method ctc-decoding \
|
|
||||||
--num-classes 500 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
log "HLG decoding"
|
|
||||||
|
|
||||||
./conformer_ctc/pretrained.py \
|
|
||||||
--method 1best \
|
|
||||||
--num-classes 500 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--words-file $repo/data/lang_bpe_500/words.txt \
|
|
||||||
--HLG $repo/data/lang_bpe_500/HLG.pt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
log "CTC decoding on CPU with kaldi decoders using OpenFst"
|
|
||||||
|
|
||||||
log "Exporting model with torchscript"
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
ln -s pretrained.pt epoch-99.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
./conformer_ctc/export.py \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1 \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
--jit 1
|
|
||||||
|
|
||||||
ls -lh $repo/exp
|
|
||||||
|
|
||||||
|
|
||||||
log "Generating H.fst, HL.fst"
|
|
||||||
|
|
||||||
./local/prepare_lang_fst.py --lang-dir $repo/data/lang_bpe_500 --ngram-G $repo/data/lm/G_3_gram.fst.txt
|
|
||||||
|
|
||||||
ls -lh $repo/data/lang_bpe_500
|
|
||||||
|
|
||||||
log "Decoding with H on CPU with OpenFst"
|
|
||||||
|
|
||||||
./conformer_ctc/jit_pretrained_decode_with_H.py \
|
|
||||||
--nn-model $repo/exp/cpu_jit.pt \
|
|
||||||
--H $repo/data/lang_bpe_500/H.fst \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
log "Decoding with HL on CPU with OpenFst"
|
|
||||||
|
|
||||||
./conformer_ctc/jit_pretrained_decode_with_HL.py \
|
|
||||||
--nn-model $repo/exp/cpu_jit.pt \
|
|
||||||
--HL $repo/data/lang_bpe_500/HL.fst \
|
|
||||||
--words $repo/data/lang_bpe_500/words.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
log "Decoding with HLG on CPU with OpenFst"
|
|
||||||
|
|
||||||
./conformer_ctc/jit_pretrained_decode_with_HLG.py \
|
|
||||||
--nn-model $repo/exp/cpu_jit.pt \
|
|
||||||
--HLG $repo/data/lang_bpe_500/HLG.fst \
|
|
||||||
--words $repo/data/lang_bpe_500/words.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
|
|
||||||
rm -rf $repo
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Test aishell"
|
|
||||||
|
|
||||||
pushd egs/aishell/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall_asr_aishell_conformer_ctc
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
pushd $repo
|
|
||||||
|
|
||||||
git lfs pull --include "exp/pretrained.pt"
|
|
||||||
git lfs pull --include "data/lang_char/H.fst"
|
|
||||||
git lfs pull --include "data/lang_char/HL.fst"
|
|
||||||
git lfs pull --include "data/lang_char/HLG.fst"
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
log "CTC decoding"
|
|
||||||
|
|
||||||
log "Exporting model with torchscript"
|
|
||||||
|
|
||||||
pushd $repo/exp
|
|
||||||
ln -s pretrained.pt epoch-99.pt
|
|
||||||
popd
|
|
||||||
|
|
||||||
./conformer_ctc/export.py \
|
|
||||||
--epoch 99 \
|
|
||||||
--avg 1 \
|
|
||||||
--exp-dir $repo/exp \
|
|
||||||
--tokens $repo/data/lang_char/tokens.txt \
|
|
||||||
--jit 1
|
|
||||||
|
|
||||||
ls -lh $repo/exp
|
|
||||||
|
|
||||||
ls -lh $repo/data/lang_char
|
|
||||||
|
|
||||||
log "Decoding with H on CPU with OpenFst"
|
|
||||||
|
|
||||||
./conformer_ctc/jit_pretrained_decode_with_H.py \
|
|
||||||
--nn-model $repo/exp/cpu_jit.pt \
|
|
||||||
--H $repo/data/lang_char/H.fst \
|
|
||||||
--tokens $repo/data/lang_char/tokens.txt \
|
|
||||||
$repo/test_wavs/0.wav \
|
|
||||||
$repo/test_wavs/1.wav \
|
|
||||||
$repo/test_wavs/2.wav
|
|
||||||
|
|
||||||
log "Decoding with HL on CPU with OpenFst"
|
|
||||||
|
|
||||||
./conformer_ctc/jit_pretrained_decode_with_HL.py \
|
|
||||||
--nn-model $repo/exp/cpu_jit.pt \
|
|
||||||
--HL $repo/data/lang_char/HL.fst \
|
|
||||||
--words $repo/data/lang_char/words.txt \
|
|
||||||
$repo/test_wavs/0.wav \
|
|
||||||
$repo/test_wavs/1.wav \
|
|
||||||
$repo/test_wavs/2.wav
|
|
||||||
|
|
||||||
log "Decoding with HLG on CPU with OpenFst"
|
|
||||||
|
|
||||||
./conformer_ctc/jit_pretrained_decode_with_HLG.py \
|
|
||||||
--nn-model $repo/exp/cpu_jit.pt \
|
|
||||||
--HLG $repo/data/lang_char/HLG.fst \
|
|
||||||
--words $repo/data/lang_char/words.txt \
|
|
||||||
$repo/test_wavs/0.wav \
|
|
||||||
$repo/test_wavs/1.wav \
|
|
||||||
$repo/test_wavs/2.wav
|
|
||||||
|
|
||||||
rm -rf $repo
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-asr-librispeech-100h-transducer-stateless-multi-datasets-bpe-500-2022-02-21
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./transducer_stateless_multi_datasets/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./transducer_stateless_multi_datasets/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p transducer_stateless_multi_datasets/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt transducer_stateless_multi_datasets/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh transducer_stateless_multi_datasets/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./transducer_stateless_multi_datasets/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir transducer_stateless_multi_datasets/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm transducer_stateless_multi_datasets/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-asr-librispeech-transducer-stateless-multi-datasets-bpe-500-2022-03-01
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./transducer_stateless_multi_datasets/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search fast_beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./transducer_stateless_multi_datasets/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p transducer_stateless_multi_datasets/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt transducer_stateless_multi_datasets/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh transducer_stateless_multi_datasets/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./transducer_stateless_multi_datasets/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir transducer_stateless_multi_datasets/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm transducer_stateless_multi_datasets/exp/*.pt
|
|
||||||
fi
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/aishell/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-aishell-transducer-stateless-modified-2-2022-03-01
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./transducer_stateless_modified-2/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--lang-dir $repo/data/lang_char \
|
|
||||||
$repo/test_wavs/BAC009S0764W0121.wav \
|
|
||||||
$repo/test_wavs/BAC009S0764W0122.wav \
|
|
||||||
$repo/test_wavs/BAC009S0764W0123.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./transducer_stateless_modified-2/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--lang-dir $repo/data/lang_char \
|
|
||||||
$repo/test_wavs/BAC009S0764W0121.wav \
|
|
||||||
$repo/test_wavs/BAC009S0764W0122.wav \
|
|
||||||
$repo/test_wavs/BAC009S0764W0123.wav
|
|
||||||
done
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/aishell/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-aishell-transducer-stateless-modified-2022-03-01
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./transducer_stateless_modified/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--lang-dir $repo/data/lang_char \
|
|
||||||
$repo/test_wavs/BAC009S0764W0121.wav \
|
|
||||||
$repo/test_wavs/BAC009S0764W0122.wav \
|
|
||||||
$repo/test_wavs/BAC009S0764W0123.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in modified_beam_search beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./transducer_stateless_modified/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--lang-dir $repo/data/lang_char \
|
|
||||||
$repo/test_wavs/BAC009S0764W0121.wav \
|
|
||||||
$repo/test_wavs/BAC009S0764W0122.wav \
|
|
||||||
$repo/test_wavs/BAC009S0764W0123.wav
|
|
||||||
done
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-asr-librispeech-transducer-stateless-bpe-500-2022-02-07
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
for sym in 1 2 3; do
|
|
||||||
log "Greedy search with --max-sym-per-frame $sym"
|
|
||||||
|
|
||||||
./transducer_stateless/pretrained.py \
|
|
||||||
--method greedy_search \
|
|
||||||
--max-sym-per-frame $sym \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
for method in fast_beam_search modified_beam_search beam_search; do
|
|
||||||
log "$method"
|
|
||||||
|
|
||||||
./transducer_stateless/pretrained.py \
|
|
||||||
--method $method \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
|
|
||||||
echo "GITHUB_EVENT_LABEL_NAME: ${GITHUB_EVENT_LABEL_NAME}"
|
|
||||||
if [[ x"${GITHUB_EVENT_NAME}" == x"schedule" || x"${GITHUB_EVENT_LABEL_NAME}" == x"run-decode" ]]; then
|
|
||||||
mkdir -p transducer_stateless/exp
|
|
||||||
ln -s $PWD/$repo/exp/pretrained.pt transducer_stateless/exp/epoch-999.pt
|
|
||||||
ln -s $PWD/$repo/data/lang_bpe_500 data/
|
|
||||||
|
|
||||||
ls -lh data
|
|
||||||
ls -lh transducer_stateless/exp
|
|
||||||
|
|
||||||
log "Decoding test-clean and test-other"
|
|
||||||
|
|
||||||
# use a small value for decoding with CPU
|
|
||||||
max_duration=100
|
|
||||||
|
|
||||||
for method in greedy_search fast_beam_search modified_beam_search; do
|
|
||||||
log "Decoding with $method"
|
|
||||||
|
|
||||||
./transducer_stateless/decode.py \
|
|
||||||
--decoding-method $method \
|
|
||||||
--epoch 999 \
|
|
||||||
--avg 1 \
|
|
||||||
--max-duration $max_duration \
|
|
||||||
--exp-dir transducer_stateless/exp
|
|
||||||
done
|
|
||||||
|
|
||||||
rm transducer_stateless/exp/*.pt
|
|
||||||
fi
|
|
||||||
33
.github/scripts/run-pre-trained-transducer.sh
vendored
33
.github/scripts/run-pre-trained-transducer.sh
vendored
@ -1,33 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log() {
|
|
||||||
# This function is from espnet
|
|
||||||
local fname=${BASH_SOURCE[1]##*/}
|
|
||||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
|
|
||||||
repo_url=https://huggingface.co/csukuangfj/icefall-asr-librispeech-transducer-bpe-500-2021-12-23
|
|
||||||
|
|
||||||
log "Downloading pre-trained model from $repo_url"
|
|
||||||
git lfs install
|
|
||||||
git clone $repo_url
|
|
||||||
repo=$(basename $repo_url)
|
|
||||||
|
|
||||||
log "Display test files"
|
|
||||||
tree $repo/
|
|
||||||
ls -lh $repo/test_wavs/*.wav
|
|
||||||
|
|
||||||
log "Beam search decoding"
|
|
||||||
|
|
||||||
./transducer/pretrained.py \
|
|
||||||
--method beam_search \
|
|
||||||
--beam-size 4 \
|
|
||||||
--checkpoint $repo/exp/pretrained.pt \
|
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
|
||||||
$repo/test_wavs/1089-134686-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0001.wav \
|
|
||||||
$repo/test_wavs/1221-135766-0002.wav
|
|
||||||
44
.github/scripts/run-swbd-conformer-ctc-2023-08-26.sh
vendored
Executable file
44
.github/scripts/run-swbd-conformer-ctc-2023-08-26.sh
vendored
Executable file
@ -0,0 +1,44 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
log() {
|
||||||
|
# This function is from espnet
|
||||||
|
local fname=${BASH_SOURCE[1]##*/}
|
||||||
|
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
cd egs/swbd/ASR
|
||||||
|
|
||||||
|
repo_url=https://huggingface.co/zrjin/icefall-asr-swbd-conformer-ctc-2023-8-26
|
||||||
|
|
||||||
|
log "Downloading pre-trained model from $repo_url"
|
||||||
|
git lfs install
|
||||||
|
git clone $repo_url
|
||||||
|
repo=$(basename $repo_url)
|
||||||
|
|
||||||
|
|
||||||
|
log "Display test files"
|
||||||
|
tree $repo/
|
||||||
|
ls -lh $repo/test_wavs/*.wav
|
||||||
|
|
||||||
|
pushd $repo/exp
|
||||||
|
ln -s epoch-98.pt epoch-99.pt
|
||||||
|
popd
|
||||||
|
|
||||||
|
ls -lh $repo/exp/*.pt
|
||||||
|
|
||||||
|
for method in ctc-decoding 1best; do
|
||||||
|
log "$method"
|
||||||
|
|
||||||
|
./conformer_ctc/pretrained.py \
|
||||||
|
--method $method \
|
||||||
|
--checkpoint $repo/exp/epoch-99.pt \
|
||||||
|
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
||||||
|
--words-file $repo/data/lang_bpe_500/words.txt \
|
||||||
|
--HLG $repo/data/lang_bpe_500/HLG.pt \
|
||||||
|
--G $repo/data/lm/G_4_gram.pt \
|
||||||
|
$repo/test_wavs/1089-134686-0001.wav \
|
||||||
|
$repo/test_wavs/1221-135766-0001.wav \
|
||||||
|
$repo/test_wavs/1221-135766-0002.wav
|
||||||
|
done
|
||||||
@ -30,7 +30,7 @@ log "Test exporting to ONNX format"
|
|||||||
|
|
||||||
./pruned_transducer_stateless2/export-onnx.py \
|
./pruned_transducer_stateless2/export-onnx.py \
|
||||||
--exp-dir $repo/exp \
|
--exp-dir $repo/exp \
|
||||||
--lang-dir $repo/data/lang_char \
|
--tokens $repo/data/lang_char/tokens.txt \
|
||||||
--epoch 99 \
|
--epoch 99 \
|
||||||
--avg 1
|
--avg 1
|
||||||
|
|
||||||
@ -38,14 +38,14 @@ log "Export to torchscript model"
|
|||||||
|
|
||||||
./pruned_transducer_stateless2/export.py \
|
./pruned_transducer_stateless2/export.py \
|
||||||
--exp-dir $repo/exp \
|
--exp-dir $repo/exp \
|
||||||
--lang-dir $repo/data/lang_char \
|
--tokens $repo/data/lang_char/tokens.txt \
|
||||||
--epoch 99 \
|
--epoch 99 \
|
||||||
--avg 1 \
|
--avg 1 \
|
||||||
--jit 1
|
--jit 1
|
||||||
|
|
||||||
./pruned_transducer_stateless2/export.py \
|
./pruned_transducer_stateless2/export.py \
|
||||||
--exp-dir $repo/exp \
|
--exp-dir $repo/exp \
|
||||||
--lang-dir $repo/data/lang_char \
|
--tokens $repo/data/lang_char/tokens.txt \
|
||||||
--epoch 99 \
|
--epoch 99 \
|
||||||
--avg 1 \
|
--avg 1 \
|
||||||
--jit-trace 1
|
--jit-trace 1
|
||||||
|
|||||||
1
.github/scripts/test-onnx-export.sh
vendored
1
.github/scripts/test-onnx-export.sh
vendored
@ -25,6 +25,7 @@ popd
|
|||||||
|
|
||||||
log "Export via torch.jit.script()"
|
log "Export via torch.jit.script()"
|
||||||
./zipformer/export.py \
|
./zipformer/export.py \
|
||||||
|
--use-averaged-model 0 \
|
||||||
--exp-dir $repo/exp \
|
--exp-dir $repo/exp \
|
||||||
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
--tokens $repo/data/lang_bpe_500/tokens.txt \
|
||||||
--epoch 99 \
|
--epoch 99 \
|
||||||
|
|||||||
86
.github/scripts/yesno/ASR/run.sh
vendored
Executable file
86
.github/scripts/yesno/ASR/run.sh
vendored
Executable file
@ -0,0 +1,86 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
log() {
|
||||||
|
# This function is from espnet
|
||||||
|
local fname=${BASH_SOURCE[1]##*/}
|
||||||
|
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
cd egs/yesno/ASR
|
||||||
|
|
||||||
|
log "data preparation"
|
||||||
|
./prepare.sh
|
||||||
|
|
||||||
|
log "training"
|
||||||
|
python3 ./tdnn/train.py
|
||||||
|
|
||||||
|
log "decoding"
|
||||||
|
python3 ./tdnn/decode.py
|
||||||
|
|
||||||
|
log "export to pretrained.pt"
|
||||||
|
|
||||||
|
python3 ./tdnn/export.py --epoch 14 --avg 2
|
||||||
|
|
||||||
|
python3 ./tdnn/pretrained.py \
|
||||||
|
--checkpoint ./tdnn/exp/pretrained.pt \
|
||||||
|
--HLG ./data/lang_phone/HLG.pt \
|
||||||
|
--words-file ./data/lang_phone/words.txt \
|
||||||
|
download/waves_yesno/0_0_0_1_0_0_0_1.wav \
|
||||||
|
download/waves_yesno/0_0_1_0_0_0_1_0.wav
|
||||||
|
|
||||||
|
log "Test exporting to torchscript"
|
||||||
|
python3 ./tdnn/export.py --epoch 14 --avg 2 --jit 1
|
||||||
|
|
||||||
|
python3 ./tdnn/jit_pretrained.py \
|
||||||
|
--nn-model ./tdnn/exp/cpu_jit.pt \
|
||||||
|
--HLG ./data/lang_phone/HLG.pt \
|
||||||
|
--words-file ./data/lang_phone/words.txt \
|
||||||
|
download/waves_yesno/0_0_0_1_0_0_0_1.wav \
|
||||||
|
download/waves_yesno/0_0_1_0_0_0_1_0.wav
|
||||||
|
|
||||||
|
log "Test exporting to onnx"
|
||||||
|
python3 ./tdnn/export_onnx.py --epoch 14 --avg 2
|
||||||
|
|
||||||
|
log "Test float32 model"
|
||||||
|
python3 ./tdnn/onnx_pretrained.py \
|
||||||
|
--nn-model ./tdnn/exp/model-epoch-14-avg-2.onnx \
|
||||||
|
--HLG ./data/lang_phone/HLG.pt \
|
||||||
|
--words-file ./data/lang_phone/words.txt \
|
||||||
|
download/waves_yesno/0_0_0_1_0_0_0_1.wav \
|
||||||
|
download/waves_yesno/0_0_1_0_0_0_1_0.wav
|
||||||
|
|
||||||
|
log "Test int8 model"
|
||||||
|
python3 ./tdnn/onnx_pretrained.py \
|
||||||
|
--nn-model ./tdnn/exp/model-epoch-14-avg-2.int8.onnx \
|
||||||
|
--HLG ./data/lang_phone/HLG.pt \
|
||||||
|
--words-file ./data/lang_phone/words.txt \
|
||||||
|
download/waves_yesno/0_0_0_1_0_0_0_1.wav \
|
||||||
|
download/waves_yesno/0_0_1_0_0_0_1_0.wav
|
||||||
|
|
||||||
|
log "Test decoding with H"
|
||||||
|
python3 ./tdnn/export.py --epoch 14 --avg 2 --jit 1
|
||||||
|
|
||||||
|
python3 ./tdnn/jit_pretrained_decode_with_H.py \
|
||||||
|
--nn-model ./tdnn/exp/cpu_jit.pt \
|
||||||
|
--H ./data/lang_phone/H.fst \
|
||||||
|
--tokens ./data/lang_phone/tokens.txt \
|
||||||
|
./download/waves_yesno/0_0_0_1_0_0_0_1.wav \
|
||||||
|
./download/waves_yesno/0_0_1_0_0_0_1_0.wav \
|
||||||
|
./download/waves_yesno/0_0_1_0_0_1_1_1.wav
|
||||||
|
|
||||||
|
log "Test decoding with HL"
|
||||||
|
python3 ./tdnn/export.py --epoch 14 --avg 2 --jit 1
|
||||||
|
|
||||||
|
python3 ./tdnn/jit_pretrained_decode_with_HL.py \
|
||||||
|
--nn-model ./tdnn/exp/cpu_jit.pt \
|
||||||
|
--HL ./data/lang_phone/HL.fst \
|
||||||
|
--words ./data/lang_phone/words.txt \
|
||||||
|
./download/waves_yesno/0_0_0_1_0_0_0_1.wav \
|
||||||
|
./download/waves_yesno/0_0_1_0_0_0_1_0.wav \
|
||||||
|
./download/waves_yesno/0_0_1_0_0_1_1_1.wav
|
||||||
|
|
||||||
|
log "Show generated files"
|
||||||
|
ls -lh tdnn/exp
|
||||||
|
ls -lh data/lang_phone
|
||||||
72
.github/workflows/aishell.yml
vendored
Normal file
72
.github/workflows/aishell.yml
vendored
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
name: aishell
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: aishell-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate_build_matrix:
|
||||||
|
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event.label.name == 'ready' || github.event_name == 'push' || github.event_name == 'aishell')
|
||||||
|
|
||||||
|
# see https://github.com/pytorch/pytorch/pull/50633
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Generating build matrix
|
||||||
|
id: set-matrix
|
||||||
|
run: |
|
||||||
|
# outputting for debugging purposes
|
||||||
|
python ./.github/scripts/docker/generate_build_matrix.py
|
||||||
|
MATRIX=$(python ./.github/scripts/docker/generate_build_matrix.py)
|
||||||
|
echo "::set-output name=matrix::${MATRIX}"
|
||||||
|
aishell:
|
||||||
|
needs: generate_build_matrix
|
||||||
|
name: py${{ matrix.python-version }} torch${{ matrix.torch-version }} v${{ matrix.version }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Free space
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
df -h
|
||||||
|
rm -rf /opt/hostedtoolcache
|
||||||
|
df -h
|
||||||
|
echo "pwd: $PWD"
|
||||||
|
echo "github.workspace ${{ github.workspace }}"
|
||||||
|
|
||||||
|
- name: Run aishell tests
|
||||||
|
uses: addnab/docker-run-action@v3
|
||||||
|
with:
|
||||||
|
image: ghcr.io/${{ github.repository_owner }}/icefall:cpu-py${{ matrix.python-version }}-torch${{ matrix.torch-version }}-v${{ matrix.version }}
|
||||||
|
options: |
|
||||||
|
--volume ${{ github.workspace }}/:/icefall
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
export PYTHONPATH=/icefall:$PYTHONPATH
|
||||||
|
cd /icefall
|
||||||
|
git config --global --add safe.directory /icefall
|
||||||
|
|
||||||
|
.github/scripts/aishell/ASR/run.sh
|
||||||
137
.github/workflows/audioset.yml
vendored
Normal file
137
.github/workflows/audioset.yml
vendored
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
name: audioset
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: audioset-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate_build_matrix:
|
||||||
|
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
|
||||||
|
# see https://github.com/pytorch/pytorch/pull/50633
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Generating build matrix
|
||||||
|
id: set-matrix
|
||||||
|
run: |
|
||||||
|
# outputting for debugging purposes
|
||||||
|
python ./.github/scripts/docker/generate_build_matrix.py
|
||||||
|
MATRIX=$(python ./.github/scripts/docker/generate_build_matrix.py)
|
||||||
|
echo "::set-output name=matrix::${MATRIX}"
|
||||||
|
|
||||||
|
audioset:
|
||||||
|
needs: generate_build_matrix
|
||||||
|
name: py${{ matrix.python-version }} torch${{ matrix.torch-version }} v${{ matrix.version }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Free space
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
ls -lh
|
||||||
|
df -h
|
||||||
|
rm -rf /opt/hostedtoolcache
|
||||||
|
df -h
|
||||||
|
echo "pwd: $PWD"
|
||||||
|
echo "github.workspace ${{ github.workspace }}"
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
uses: addnab/docker-run-action@v3
|
||||||
|
with:
|
||||||
|
image: ghcr.io/${{ github.repository_owner }}/icefall:cpu-py${{ matrix.python-version }}-torch${{ matrix.torch-version }}-v${{ matrix.version }}
|
||||||
|
options: |
|
||||||
|
--volume ${{ github.workspace }}/:/icefall
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
export PYTHONPATH=/icefall:$PYTHONPATH
|
||||||
|
cd /icefall
|
||||||
|
git config --global --add safe.directory /icefall
|
||||||
|
|
||||||
|
.github/scripts/audioset/AT/run.sh
|
||||||
|
|
||||||
|
- name: Show model files
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo chown -R runner ./model-onnx
|
||||||
|
ls -lh ./model-onnx
|
||||||
|
chmod -x ./model-onnx/class_labels_indices.csv
|
||||||
|
|
||||||
|
echo "----------"
|
||||||
|
ls -lh ./model-onnx/*
|
||||||
|
|
||||||
|
- name: Upload model to huggingface
|
||||||
|
if: matrix.python-version == '3.9' && matrix.torch-version == '2.2.0' && github.event_name == 'push'
|
||||||
|
env:
|
||||||
|
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||||
|
uses: nick-fields/retry@v3
|
||||||
|
with:
|
||||||
|
max_attempts: 20
|
||||||
|
timeout_seconds: 200
|
||||||
|
shell: bash
|
||||||
|
command: |
|
||||||
|
git config --global user.email "csukuangfj@gmail.com"
|
||||||
|
git config --global user.name "Fangjun Kuang"
|
||||||
|
|
||||||
|
rm -rf huggingface
|
||||||
|
export GIT_LFS_SKIP_SMUDGE=1
|
||||||
|
|
||||||
|
git clone https://huggingface.co/k2-fsa/sherpa-onnx-zipformer-audio-tagging-2024-04-09 huggingface
|
||||||
|
cd huggingface
|
||||||
|
git fetch
|
||||||
|
git pull
|
||||||
|
git merge -m "merge remote" --ff origin main
|
||||||
|
cp ../model-onnx/*.onnx ./
|
||||||
|
cp ../model-onnx/*.csv ./
|
||||||
|
cp -a ../model-onnx/test_wavs ./
|
||||||
|
ls -lh
|
||||||
|
git add .
|
||||||
|
git status
|
||||||
|
git commit -m "update models"
|
||||||
|
git status
|
||||||
|
|
||||||
|
git push https://csukuangfj:$HF_TOKEN@huggingface.co/k2-fsa/sherpa-onnx-zipformer-audio-tagging-2024-04-09 main || true
|
||||||
|
rm -rf huggingface
|
||||||
|
|
||||||
|
- name: Prepare for release
|
||||||
|
if: matrix.python-version == '3.9' && matrix.torch-version == '2.2.0' && github.event_name == 'push'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
d=sherpa-onnx-zipformer-audio-tagging-2024-04-09
|
||||||
|
mv ./model-onnx $d
|
||||||
|
tar cjvf ${d}.tar.bz2 $d
|
||||||
|
ls -lh
|
||||||
|
|
||||||
|
- name: Release exported onnx models
|
||||||
|
if: matrix.python-version == '3.9' && matrix.torch-version == '2.2.0' && github.event_name == 'push'
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
with:
|
||||||
|
file_glob: true
|
||||||
|
overwrite: true
|
||||||
|
file: sherpa-onnx-*.tar.bz2
|
||||||
|
repo_name: k2-fsa/sherpa-onnx
|
||||||
|
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||||
|
tag: audio-tagging-models
|
||||||
|
|
||||||
81
.github/workflows/build-cpu-docker.yml
vendored
Normal file
81
.github/workflows/build-cpu-docker.yml
vendored
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
name: build-cpu-docker
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: build-cpu-docker-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate_build_matrix:
|
||||||
|
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
|
||||||
|
# see https://github.com/pytorch/pytorch/pull/50633
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Generating build matrix
|
||||||
|
id: set-matrix
|
||||||
|
run: |
|
||||||
|
# outputting for debugging purposes
|
||||||
|
python ./.github/scripts/docker/generate_build_matrix.py
|
||||||
|
MATRIX=$(python ./.github/scripts/docker/generate_build_matrix.py)
|
||||||
|
echo "::set-output name=matrix::${MATRIX}"
|
||||||
|
build-cpu-docker:
|
||||||
|
needs: generate_build_matrix
|
||||||
|
name: py${{ matrix.python-version }} torch${{ matrix.torch-version }} v${{ matrix.version }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# refer to https://github.com/actions/checkout
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Free space
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
df -h
|
||||||
|
rm -rf /opt/hostedtoolcache
|
||||||
|
df -h
|
||||||
|
|
||||||
|
- name: 'Login to GitHub Container Registry'
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build docker Image
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd .github/scripts/docker
|
||||||
|
torch_version=${{ matrix.torch-version }}
|
||||||
|
torchaudio_version=${{ matrix.torchaudio-version }}
|
||||||
|
|
||||||
|
echo "torch_version: $torch_version"
|
||||||
|
echo "torchaudio_version: $torchaudio_version"
|
||||||
|
|
||||||
|
version=${{ matrix.version }}
|
||||||
|
|
||||||
|
tag=ghcr.io/${{ github.repository_owner }}/icefall:cpu-py${{ matrix.python-version }}-torch${{ matrix.torch-version }}-v$version
|
||||||
|
echo "tag: $tag"
|
||||||
|
|
||||||
|
docker build \
|
||||||
|
-t $tag \
|
||||||
|
--build-arg PYTHON_VERSION=${{ matrix.python-version }} \
|
||||||
|
--build-arg TORCH_VERSION=$torch_version \
|
||||||
|
--build-arg TORCHAUDIO_VERSION=$torchaudio_version \
|
||||||
|
--build-arg K2_VERSION=${{ matrix.k2-version }} \
|
||||||
|
--build-arg KALDIFEAT_VERSION=${{ matrix.kaldifeat-version }} \
|
||||||
|
.
|
||||||
|
|
||||||
|
docker image ls
|
||||||
|
docker push $tag
|
||||||
5
.github/workflows/build-doc.yml
vendored
5
.github/workflows/build-doc.yml
vendored
@ -26,6 +26,8 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
types: [labeled]
|
types: [labeled]
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: build_doc-${{ github.ref }}
|
group: build_doc-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@ -56,11 +58,14 @@ jobs:
|
|||||||
- name: Build doc
|
- name: Build doc
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
.github/scripts/generate-piper-phonemize-page.py
|
||||||
cd docs
|
cd docs
|
||||||
python3 -m pip install -r ./requirements.txt
|
python3 -m pip install -r ./requirements.txt
|
||||||
make html
|
make html
|
||||||
touch build/html/.nojekyll
|
touch build/html/.nojekyll
|
||||||
|
|
||||||
|
cp -v ../piper_phonemize.html ./build/html/
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
41
.github/workflows/build-docker-image.yml
vendored
41
.github/workflows/build-docker-image.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
image: ["torch2.0.0-cuda11.7", "torch1.13.0-cuda11.6", "torch1.12.1-cuda11.3", "torch1.9.0-cuda10.2"]
|
image: ["torch2.4.1-cuda12.4", "torch2.4.1-cuda12.1", "torch2.4.1-cuda11.8", "torch2.4.0-cuda12.4", "torch2.4.0-cuda12.1", "torch2.4.0-cuda11.8", "torch2.3.1-cuda12.1", "torch2.3.1-cuda11.8", "torch2.2.2-cuda12.1", "torch2.2.2-cuda11.8", "torch2.2.1-cuda12.1", "torch2.2.1-cuda11.8", "torch2.2.0-cuda12.1", "torch2.2.0-cuda11.8", "torch2.1.0-cuda12.1", "torch2.1.0-cuda11.8", "torch2.0.0-cuda11.7", "torch1.13.0-cuda11.6", "torch1.12.1-cuda11.3", "torch1.9.0-cuda10.2"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# refer to https://github.com/actions/checkout
|
# refer to https://github.com/actions/checkout
|
||||||
@ -30,6 +30,45 @@ jobs:
|
|||||||
image=${{ matrix.image }}
|
image=${{ matrix.image }}
|
||||||
mv -v ./docker/$image.dockerfile ./Dockerfile
|
mv -v ./docker/$image.dockerfile ./Dockerfile
|
||||||
|
|
||||||
|
- name: Free space
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
df -h
|
||||||
|
rm -rf /opt/hostedtoolcache
|
||||||
|
df -h
|
||||||
|
|
||||||
|
- name: Free more space
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# https://github.com/orgs/community/discussions/25678
|
||||||
|
cd /opt
|
||||||
|
find . -maxdepth 1 -mindepth 1 '!' -path ./containerd '!' -path ./actionarchivecache '!' -path ./runner '!' -path ./runner-cache -exec rm -rf '{}' ';'
|
||||||
|
|
||||||
|
sudo rm -rf /usr/share/dotnet
|
||||||
|
sudo rm -rf "/usr/local/share/boost"
|
||||||
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||||
|
|
||||||
|
- name: Free Disk Space (Ubuntu)
|
||||||
|
uses: jlumbroso/free-disk-space@main
|
||||||
|
with:
|
||||||
|
# this might remove tools that are actually needed,
|
||||||
|
# if set to "true" but frees about 6 GB
|
||||||
|
tool-cache: false
|
||||||
|
|
||||||
|
# all of these default to true, but feel free to set to
|
||||||
|
# "false" if necessary for your workflow
|
||||||
|
android: true
|
||||||
|
dotnet: true
|
||||||
|
haskell: true
|
||||||
|
large-packages: true
|
||||||
|
docker-images: false
|
||||||
|
swap-storage: true
|
||||||
|
|
||||||
|
- name: Check space
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
df -h
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
167
.github/workflows/ksponspeech.yml
vendored
Normal file
167
.github/workflows/ksponspeech.yml
vendored
Normal file
@ -0,0 +1,167 @@
|
|||||||
|
name: ksponspeech
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- ksponspeech
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ksponspeech:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
python-version: [3.8]
|
||||||
|
fail-fast: false
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
cache: 'pip'
|
||||||
|
cache-dependency-path: '**/requirements-ci.txt'
|
||||||
|
|
||||||
|
- name: Install Python dependencies
|
||||||
|
run: |
|
||||||
|
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
||||||
|
pip uninstall -y protobuf
|
||||||
|
pip install --no-binary protobuf protobuf==3.20.*
|
||||||
|
|
||||||
|
- name: Cache kaldifeat
|
||||||
|
id: my-cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/tmp/kaldifeat
|
||||||
|
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
||||||
|
|
||||||
|
- name: Install kaldifeat
|
||||||
|
if: steps.my-cache.outputs.cache-hit != 'true'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
.github/scripts/install-kaldifeat.sh
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
export PYTHONPATH=$PWD:$PYTHONPATH
|
||||||
|
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
||||||
|
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
||||||
|
|
||||||
|
.github/scripts/ksponspeech/ASR/run.sh
|
||||||
|
|
||||||
|
- name: Show model files (2024-06-24)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
src=/tmp/model-2024-06-24
|
||||||
|
ls -lh $src
|
||||||
|
|
||||||
|
- name: Show model files (2024-06-16)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
src=/tmp/model-2024-06-16
|
||||||
|
ls -lh $src
|
||||||
|
|
||||||
|
- name: Upload model to huggingface (2024-06-24)
|
||||||
|
env:
|
||||||
|
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||||
|
uses: nick-fields/retry@v3
|
||||||
|
with:
|
||||||
|
max_attempts: 20
|
||||||
|
timeout_seconds: 200
|
||||||
|
shell: bash
|
||||||
|
command: |
|
||||||
|
src=/tmp/model-2024-06-24
|
||||||
|
git config --global user.email "csukuangfj@gmail.com"
|
||||||
|
git config --global user.name "Fangjun Kuang"
|
||||||
|
|
||||||
|
rm -rf hf
|
||||||
|
export GIT_LFS_SKIP_SMUDGE=1
|
||||||
|
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||||
|
|
||||||
|
git clone https://huggingface.co/k2-fsa/sherpa-onnx-zipformer-korean-2024-06-24 hf
|
||||||
|
cd hf
|
||||||
|
git fetch
|
||||||
|
git pull
|
||||||
|
git merge -m "merge remote" --ff origin main
|
||||||
|
cp -av $src/* ./
|
||||||
|
ls -lh
|
||||||
|
git lfs track "bpe.model"
|
||||||
|
git lfs track "*.onnx"
|
||||||
|
git add .
|
||||||
|
git status
|
||||||
|
git commit -m "update models"
|
||||||
|
git status
|
||||||
|
|
||||||
|
git push https://csukuangfj:$HF_TOKEN@huggingface.co/k2-fsa/sherpa-onnx-zipformer-korean-2024-06-24 main || true
|
||||||
|
rm -rf hf
|
||||||
|
|
||||||
|
- name: Upload model to huggingface (2024-06-16)
|
||||||
|
env:
|
||||||
|
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||||
|
uses: nick-fields/retry@v3
|
||||||
|
with:
|
||||||
|
max_attempts: 20
|
||||||
|
timeout_seconds: 200
|
||||||
|
shell: bash
|
||||||
|
command: |
|
||||||
|
src=/tmp/model-2024-06-16
|
||||||
|
git config --global user.email "csukuangfj@gmail.com"
|
||||||
|
git config --global user.name "Fangjun Kuang"
|
||||||
|
|
||||||
|
rm -rf hf
|
||||||
|
export GIT_LFS_SKIP_SMUDGE=1
|
||||||
|
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||||
|
|
||||||
|
git clone https://huggingface.co/k2-fsa/sherpa-onnx-streaming-zipformer-korean-2024-06-16 hf
|
||||||
|
cd hf
|
||||||
|
git fetch
|
||||||
|
git pull
|
||||||
|
git merge -m "merge remote" --ff origin main
|
||||||
|
cp -v $src/* ./
|
||||||
|
ls -lh
|
||||||
|
git lfs track "bpe.model"
|
||||||
|
git lfs track "*.onnx"
|
||||||
|
cp -av test_wavs $src/
|
||||||
|
git add .
|
||||||
|
git status
|
||||||
|
git commit -m "update models"
|
||||||
|
git status
|
||||||
|
|
||||||
|
git push https://csukuangfj:$HF_TOKEN@huggingface.co/k2-fsa/sherpa-onnx-streaming-zipformer-korean-2024-06-16 main || true
|
||||||
|
rm -rf hf
|
||||||
|
|
||||||
|
- name: Prepare for release (2024-06-16)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
src=/tmp/model-2024-06-16
|
||||||
|
d=sherpa-onnx-streaming-zipformer-korean-2024-06-16
|
||||||
|
mv $src ./$d
|
||||||
|
tar cjvf ${d}.tar.bz2 $d
|
||||||
|
ls -lh
|
||||||
|
|
||||||
|
- name: Prepare for release (2024-06-24)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
src=/tmp/model-2024-06-24
|
||||||
|
d=sherpa-onnx-zipformer-korean-2024-06-24
|
||||||
|
mv $src ./$d
|
||||||
|
tar cjvf ${d}.tar.bz2 $d
|
||||||
|
ls -lh
|
||||||
|
|
||||||
|
- name: Release exported onnx models
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
with:
|
||||||
|
file_glob: true
|
||||||
|
overwrite: true
|
||||||
|
file: sherpa-onnx-*.tar.bz2
|
||||||
|
repo_name: k2-fsa/sherpa-onnx
|
||||||
|
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||||
|
tag: asr-models
|
||||||
71
.github/workflows/librispeech.yml
vendored
Normal file
71
.github/workflows/librispeech.yml
vendored
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
name: librispeech
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: librispeech-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate_build_matrix:
|
||||||
|
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
|
||||||
|
# see https://github.com/pytorch/pytorch/pull/50633
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Generating build matrix
|
||||||
|
id: set-matrix
|
||||||
|
run: |
|
||||||
|
# outputting for debugging purposes
|
||||||
|
python ./.github/scripts/docker/generate_build_matrix.py
|
||||||
|
MATRIX=$(python ./.github/scripts/docker/generate_build_matrix.py)
|
||||||
|
echo "::set-output name=matrix::${MATRIX}"
|
||||||
|
librispeech:
|
||||||
|
needs: generate_build_matrix
|
||||||
|
name: py${{ matrix.python-version }} torch${{ matrix.torch-version }} v${{ matrix.version }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# refer to https://github.com/actions/checkout
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Free space
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
df -h
|
||||||
|
rm -rf /opt/hostedtoolcache
|
||||||
|
df -h
|
||||||
|
echo "pwd: $PWD"
|
||||||
|
echo "github.workspace ${{ github.workspace }}"
|
||||||
|
|
||||||
|
- name: Test zipformer/train.py with LibriSpeech
|
||||||
|
uses: addnab/docker-run-action@v3
|
||||||
|
with:
|
||||||
|
image: ghcr.io/${{ github.repository_owner }}/icefall:cpu-py${{ matrix.python-version }}-torch${{ matrix.torch-version }}-v${{ matrix.version }}
|
||||||
|
options: |
|
||||||
|
--volume ${{ github.workspace }}/:/icefall
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
export PYTHONPATH=/icefall:$PYTHONPATH
|
||||||
|
cd /icefall
|
||||||
|
git config --global --add safe.directory /icefall
|
||||||
|
|
||||||
|
.github/scripts/librispeech/ASR/run.sh
|
||||||
102
.github/workflows/ljspeech.yml
vendored
Normal file
102
.github/workflows/ljspeech.yml
vendored
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
name: ljspeech
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ljspeech-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate_build_matrix:
|
||||||
|
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
|
||||||
|
# see https://github.com/pytorch/pytorch/pull/50633
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Generating build matrix
|
||||||
|
id: set-matrix
|
||||||
|
run: |
|
||||||
|
# outputting for debugging purposes
|
||||||
|
python ./.github/scripts/docker/generate_build_matrix.py
|
||||||
|
MATRIX=$(python ./.github/scripts/docker/generate_build_matrix.py)
|
||||||
|
echo "::set-output name=matrix::${MATRIX}"
|
||||||
|
|
||||||
|
ljspeech:
|
||||||
|
needs: generate_build_matrix
|
||||||
|
name: py${{ matrix.python-version }} torch${{ matrix.torch-version }} v${{ matrix.version }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Free space
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
ls -lh
|
||||||
|
df -h
|
||||||
|
rm -rf /opt/hostedtoolcache
|
||||||
|
df -h
|
||||||
|
echo "pwd: $PWD"
|
||||||
|
echo "github.workspace ${{ github.workspace }}"
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
uses: addnab/docker-run-action@v3
|
||||||
|
with:
|
||||||
|
image: ghcr.io/${{ github.repository_owner }}/icefall:cpu-py${{ matrix.python-version }}-torch${{ matrix.torch-version }}-v${{ matrix.version }}
|
||||||
|
options: |
|
||||||
|
--volume ${{ github.workspace }}/:/icefall
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
export PYTHONPATH=/icefall:$PYTHONPATH
|
||||||
|
cd /icefall
|
||||||
|
git config --global --add safe.directory /icefall
|
||||||
|
|
||||||
|
.github/scripts/ljspeech/TTS/run.sh
|
||||||
|
|
||||||
|
- name: display files
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
ls -lh
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: matrix.python-version == '3.9' && matrix.torch-version == '2.2.0'
|
||||||
|
with:
|
||||||
|
name: generated-test-files-${{ matrix.python-version }}-${{ matrix.torch-version }}
|
||||||
|
path: ./*.wav
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: matrix.python-version == '3.9' && matrix.torch-version == '2.2.0'
|
||||||
|
with:
|
||||||
|
name: generated-models-py${{ matrix.python-version }}-torch${{ matrix.torch-version }}
|
||||||
|
path: ./*.wav
|
||||||
|
|
||||||
|
- name: Release exported onnx models
|
||||||
|
if: matrix.python-version == '3.9' && matrix.torch-version == '2.2.0' && github.event_name == 'push'
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
with:
|
||||||
|
file_glob: true
|
||||||
|
overwrite: true
|
||||||
|
file: vits-icefall-*.tar.bz2
|
||||||
|
repo_name: k2-fsa/sherpa-onnx
|
||||||
|
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||||
|
tag: tts-models
|
||||||
|
|
||||||
@ -1,45 +1,30 @@
|
|||||||
# Copyright 2021 Fangjun Kuang (csukuangfj@gmail.com)
|
name: run-multi-zh-hans
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-pre-trained-transducer
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: run_pre_trained_transducer-${{ github.ref }}
|
group: run-multi-zh-hans-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run_pre_trained_transducer:
|
multi-zh-hans:
|
||||||
if: github.event.label.name == 'ready' || github.event_name == 'push'
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
python-version: [3.8]
|
python-version: [3.8]
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
@ -68,13 +53,27 @@ jobs:
|
|||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
if: steps.my-cache.outputs.cache-hit != 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
make -j2 _kaldifeat
|
.github/scripts/install-kaldifeat.sh
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
- name: export-model
|
||||||
shell: bash
|
shell: bash
|
||||||
|
env:
|
||||||
|
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get -qq install git-lfs tree
|
sudo apt-get -qq install git-lfs tree
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
export PYTHONPATH=$PWD:$PYTHONPATH
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
||||||
.github/scripts/run-pre-trained-transducer.sh
|
|
||||||
|
.github/scripts/multi-zh-hans.sh
|
||||||
|
ls -lh
|
||||||
|
|
||||||
|
- name: upload model to https://github.com/k2-fsa/sherpa-onnx
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
with:
|
||||||
|
file_glob: true
|
||||||
|
file: ./*.tar.bz2
|
||||||
|
overwrite: true
|
||||||
|
repo_name: k2-fsa/sherpa-onnx
|
||||||
|
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||||
|
tag: asr-models
|
||||||
123
.github/workflows/run-aishell-2022-06-20.yml
vendored
123
.github/workflows/run-aishell-2022-06-20.yml
vendored
@ -1,123 +0,0 @@
|
|||||||
# Copyright 2022 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-aishell-2022-06-20
|
|
||||||
# pruned RNN-T + reworked model with random combiner
|
|
||||||
# https://huggingface.co/csukuangfj/icefall-aishell-pruned-transducer-stateless3-2022-06-20
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_aishell_2022_06_20-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_aishell_2022_06_20:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-aishell-pruned-transducer-stateless3-2022-06-20.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for aishell pruned_transducer_stateless3
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/aishell/ASR/
|
|
||||||
tree ./pruned_transducer_stateless3/exp
|
|
||||||
|
|
||||||
cd pruned_transducer_stateless3
|
|
||||||
echo "results for pruned_transducer_stateless3"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test" {} + | sort -n -k2
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for dev" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test" {} + | sort -n -k2
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for dev" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test" {} + | sort -n -k2
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for dev" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for aishell pruned_transducer_stateless3
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: aishell-torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-pruned_transducer_stateless3-2022-06-20
|
|
||||||
path: egs/aishell/ASR/pruned_transducer_stateless3/exp/
|
|
||||||
54
.github/workflows/run-docker-image.yml
vendored
54
.github/workflows/run-docker-image.yml
vendored
@ -14,13 +14,52 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
image: ["torch2.0.0-cuda11.7", "torch1.13.0-cuda11.6", "torch1.12.1-cuda11.3", "torch1.9.0-cuda10.2"]
|
image: ["torch2.4.0-cuda12.4", "torch2.4.0-cuda12.1", "torch2.4.0-cuda11.8", "torch2.3.1-cuda12.1", "torch2.3.1-cuda11.8", "torch2.2.2-cuda12.1", "torch2.2.2-cuda11.8", "torch2.2.1-cuda12.1", "torch2.2.1-cuda11.8", "torch2.2.0-cuda12.1", "torch2.2.0-cuda11.8", "torch2.1.0-cuda12.1", "torch2.1.0-cuda11.8", "torch2.0.0-cuda11.7", "torch1.13.0-cuda11.6", "torch1.12.1-cuda11.3", "torch1.9.0-cuda10.2"]
|
||||||
steps:
|
steps:
|
||||||
# refer to https://github.com/actions/checkout
|
# refer to https://github.com/actions/checkout
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Free space
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
df -h
|
||||||
|
rm -rf /opt/hostedtoolcache
|
||||||
|
df -h
|
||||||
|
|
||||||
|
- name: Free more space
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# https://github.com/orgs/community/discussions/25678
|
||||||
|
cd /opt
|
||||||
|
find . -maxdepth 1 -mindepth 1 '!' -path ./containerd '!' -path ./actionarchivecache '!' -path ./runner '!' -path ./runner-cache -exec rm -rf '{}' ';'
|
||||||
|
|
||||||
|
sudo rm -rf /usr/share/dotnet
|
||||||
|
sudo rm -rf "/usr/local/share/boost"
|
||||||
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||||
|
|
||||||
|
- name: Free Disk Space (Ubuntu)
|
||||||
|
uses: jlumbroso/free-disk-space@main
|
||||||
|
with:
|
||||||
|
# this might remove tools that are actually needed,
|
||||||
|
# if set to "true" but frees about 6 GB
|
||||||
|
tool-cache: false
|
||||||
|
|
||||||
|
# all of these default to true, but feel free to set to
|
||||||
|
# "false" if necessary for your workflow
|
||||||
|
android: true
|
||||||
|
dotnet: true
|
||||||
|
haskell: true
|
||||||
|
large-packages: true
|
||||||
|
docker-images: false
|
||||||
|
swap-storage: true
|
||||||
|
|
||||||
|
- name: Check space
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
df -h
|
||||||
|
|
||||||
- name: Run the build process with Docker
|
- name: Run the build process with Docker
|
||||||
uses: addnab/docker-run-action@v3
|
uses: addnab/docker-run-action@v3
|
||||||
with:
|
with:
|
||||||
@ -30,8 +69,15 @@ jobs:
|
|||||||
uname -a
|
uname -a
|
||||||
cat /etc/*release
|
cat /etc/*release
|
||||||
|
|
||||||
|
find / -name libcuda* 2>/dev/null
|
||||||
|
|
||||||
|
ls -lh /usr/local/
|
||||||
|
ls -lh /usr/local/cuda*
|
||||||
|
|
||||||
nvcc --version
|
nvcc --version
|
||||||
|
|
||||||
|
ls -lh /usr/local/cuda-*/compat/*
|
||||||
|
|
||||||
# For torch1.9.0-cuda10.2
|
# For torch1.9.0-cuda10.2
|
||||||
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/compat:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/compat:$LD_LIBRARY_PATH
|
||||||
|
|
||||||
@ -41,6 +87,12 @@ jobs:
|
|||||||
# For torch2.0.0-cuda11.7
|
# For torch2.0.0-cuda11.7
|
||||||
export LD_LIBRARY_PATH=/usr/local/cuda-11.7/compat:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=/usr/local/cuda-11.7/compat:$LD_LIBRARY_PATH
|
||||||
|
|
||||||
|
# For torch2.1.0-cuda11.8
|
||||||
|
export LD_LIBRARY_PATH=/usr/local/cuda-11.8/compat:$LD_LIBRARY_PATH
|
||||||
|
|
||||||
|
# For torch2.1.0-cuda12.1
|
||||||
|
export LD_LIBRARY_PATH=/usr/local/cuda-12.1/compat:$LD_LIBRARY_PATH
|
||||||
|
|
||||||
|
|
||||||
which nvcc
|
which nvcc
|
||||||
cuda_dir=$(dirname $(which nvcc))
|
cuda_dir=$(dirname $(which nvcc))
|
||||||
|
|||||||
@ -33,6 +33,8 @@ on:
|
|||||||
# nightly build at 15:50 UTC time every day
|
# nightly build at 15:50 UTC time every day
|
||||||
- cron: "50 15 * * *"
|
- cron: "50 15 * * *"
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: run_gigaspeech_2022_05_13-${{ github.ref }}
|
group: run_gigaspeech_2022_05_13-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@ -119,7 +121,7 @@ jobs:
|
|||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test" {} + | sort -n -k2
|
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test" {} + | sort -n -k2
|
||||||
|
|
||||||
- name: Upload decoding results for gigaspeech pruned_transducer_stateless2
|
- name: Upload decoding results for gigaspeech pruned_transducer_stateless2
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
||||||
with:
|
with:
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-gigaspeech-pruned_transducer_stateless2-2022-05-12
|
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-gigaspeech-pruned_transducer_stateless2-2022-05-12
|
||||||
|
|||||||
@ -14,13 +14,14 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
name: run-librispeech-zipformer-2023-05-18
|
name: run-gigaspeech-zipformer-2023-10-17
|
||||||
# zipformer
|
# zipformer
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [labeled]
|
types: [labeled]
|
||||||
|
|
||||||
@ -33,13 +34,15 @@ on:
|
|||||||
# nightly build at 15:50 UTC time every day
|
# nightly build at 15:50 UTC time every day
|
||||||
- cron: "50 15 * * *"
|
- cron: "50 15 * * *"
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: run_librispeech_2023_05_18_zipformer-${{ github.ref }}
|
group: run_gigaspeech_2023_10_17_zipformer-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run_librispeech_2023_05_18_zipformer:
|
run_gigaspeech_2023_10_17_zipformer:
|
||||||
if: github.event.label.name == 'zipformer' ||github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
if: github.event.label.name == 'zipformer' ||github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -80,61 +83,39 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
.github/scripts/install-kaldifeat.sh
|
.github/scripts/install-kaldifeat.sh
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
- name: Inference with pre-trained model
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
||||||
|
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
mkdir -p egs/librispeech/ASR/data
|
mkdir -p egs/gigaspeech/ASR/data
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
ln -sfv ~/tmp/fbank-libri egs/gigaspeech/ASR/data/fbank
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
ls -lh egs/gigaspeech/ASR/data/*
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
sudo apt-get -qq install git-lfs tree
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
export PYTHONPATH=$PWD:$PYTHONPATH
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
||||||
|
|
||||||
.github/scripts/run-librispeech-zipformer-2023-05-18.sh
|
.github/scripts/run-gigaspeech-zipformer-2023-10-17.sh
|
||||||
|
|
||||||
- name: Display decoding results for librispeech zipformer
|
- name: upload model to https://github.com/k2-fsa/sherpa-onnx
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
with:
|
||||||
|
file_glob: true
|
||||||
|
file: ./*.tar.bz2
|
||||||
|
overwrite: true
|
||||||
|
repo_name: k2-fsa/sherpa-onnx
|
||||||
|
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||||
|
tag: asr-models
|
||||||
|
|
||||||
|
- name: Display decoding results for gigaspeech zipformer
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd egs/librispeech/ASR/
|
cd egs/gigaspeech/ASR/
|
||||||
tree ./zipformer/exp
|
tree ./zipformer/exp
|
||||||
|
|
||||||
cd zipformer
|
cd zipformer
|
||||||
@ -151,9 +132,9 @@ jobs:
|
|||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
||||||
|
|
||||||
- name: Upload decoding results for librispeech zipformer
|
- name: Upload decoding results for gigaspeech zipformer
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
||||||
with:
|
with:
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-zipformer-2022-11-11
|
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-zipformer-2022-11-11
|
||||||
path: egs/librispeech/ASR/zipformer/exp/
|
path: egs/gigaspeech/ASR/zipformer/exp/
|
||||||
159
.github/workflows/run-librispeech-2022-03-12.yml
vendored
159
.github/workflows/run-librispeech-2022-03-12.yml
vendored
@ -1,159 +0,0 @@
|
|||||||
# Copyright 2021 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-2022-03-12
|
|
||||||
# stateless transducer + k2 pruned rnnt-loss
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_librispeech_2022_03_12-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_2022_03_12:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-pruned-transducer-stateless-2022-03-12.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for pruned_transducer_stateless
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./pruned_transducer_stateless/exp
|
|
||||||
|
|
||||||
cd pruned_transducer_stateless
|
|
||||||
echo "results for pruned_transducer_stateless"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for pruned_transducer_stateless
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-pruned_transducer_stateless-2022-03-12
|
|
||||||
path: egs/librispeech/ASR/pruned_transducer_stateless/exp/
|
|
||||||
185
.github/workflows/run-librispeech-2022-04-29.yml
vendored
185
.github/workflows/run-librispeech-2022-04-29.yml
vendored
@ -1,185 +0,0 @@
|
|||||||
# Copyright 2021 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-2022-04-29
|
|
||||||
# stateless pruned transducer (reworked model) + giga speech
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_librispeech_2022_04_29-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_2022_04_29:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-pruned-transducer-stateless2-2022-04-29.sh
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-pruned-transducer-stateless3-2022-04-29.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for pruned_transducer_stateless2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
tree pruned_transducer_stateless2/exp
|
|
||||||
cd pruned_transducer_stateless2/exp
|
|
||||||
echo "===greedy search==="
|
|
||||||
find greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Display decoding results for pruned_transducer_stateless3
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
tree pruned_transducer_stateless3/exp
|
|
||||||
cd pruned_transducer_stateless3/exp
|
|
||||||
echo "===greedy search==="
|
|
||||||
find greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for pruned_transducer_stateless2
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-pruned_transducer_stateless2-2022-04-29
|
|
||||||
path: egs/librispeech/ASR/pruned_transducer_stateless2/exp/
|
|
||||||
|
|
||||||
- name: Upload decoding results for pruned_transducer_stateless3
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-pruned_transducer_stateless3-2022-04-29
|
|
||||||
path: egs/librispeech/ASR/pruned_transducer_stateless3/exp/
|
|
||||||
159
.github/workflows/run-librispeech-2022-05-13.yml
vendored
159
.github/workflows/run-librispeech-2022-05-13.yml
vendored
@ -1,159 +0,0 @@
|
|||||||
# Copyright 2022 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-2022-05-13
|
|
||||||
# stateless transducer + k2 pruned rnnt-loss + deeper model
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_librispeech_2022_05_13-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_2022_05_13:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-pruned-transducer-stateless5-2022-05-13.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for librispeech pruned_transducer_stateless5
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./pruned_transducer_stateless5/exp
|
|
||||||
|
|
||||||
cd pruned_transducer_stateless5
|
|
||||||
echo "results for pruned_transducer_stateless5"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for librispeech pruned_transducer_stateless5
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-pruned_transducer_stateless5-2022-05-13
|
|
||||||
path: egs/librispeech/ASR/pruned_transducer_stateless5/exp/
|
|
||||||
@ -1,159 +0,0 @@
|
|||||||
# Copyright 2022 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-2022-11-11-stateless7
|
|
||||||
# zipformer
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_librispeech_2022_11_11_zipformer-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_2022_11_11_zipformer:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-pruned-transducer-stateless7-2022-11-11.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for librispeech pruned_transducer_stateless7
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./pruned_transducer_stateless7/exp
|
|
||||||
|
|
||||||
cd pruned_transducer_stateless7
|
|
||||||
echo "results for pruned_transducer_stateless7"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for librispeech pruned_transducer_stateless7
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-pruned_transducer_stateless7-2022-11-11
|
|
||||||
path: egs/librispeech/ASR/pruned_transducer_stateless7/exp/
|
|
||||||
@ -1,159 +0,0 @@
|
|||||||
# Copyright 2022 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-2022-11-14-stateless8
|
|
||||||
# zipformer
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_librispeech_2022_11_14_zipformer_stateless8-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_2022_11_14_zipformer_stateless8:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-pruned-transducer-stateless8-2022-11-14.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for librispeech pruned_transducer_stateless8
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./pruned_transducer_stateless8/exp
|
|
||||||
|
|
||||||
cd pruned_transducer_stateless8
|
|
||||||
echo "results for pruned_transducer_stateless8"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for librispeech pruned_transducer_stateless8
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-pruned_transducer_stateless8-2022-11-14
|
|
||||||
path: egs/librispeech/ASR/pruned_transducer_stateless8/exp/
|
|
||||||
@ -1,163 +0,0 @@
|
|||||||
# Copyright 2022 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-2022-12-01-stateless7-ctc
|
|
||||||
# zipformer
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_2022_11_11_zipformer:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-pruned-transducer-stateless7-ctc-2022-12-01.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for librispeech pruned_transducer_stateless7_ctc
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./pruned_transducer_stateless7_ctc/exp
|
|
||||||
|
|
||||||
cd pruned_transducer_stateless7_ctc
|
|
||||||
echo "results for pruned_transducer_stateless7_ctc"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===ctc decoding==="
|
|
||||||
find exp/ctc-decoding -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/ctc-decoding -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===1best==="
|
|
||||||
find exp/1best -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/1best -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for librispeech pruned_transducer_stateless7_ctc
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-pruned_transducer_stateless7-ctc-2022-12-01
|
|
||||||
path: egs/librispeech/ASR/pruned_transducer_stateless7_ctc/exp/
|
|
||||||
@ -1,167 +0,0 @@
|
|||||||
# Copyright 2022 Zengwei Yao
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-2022-12-08-zipformer-mmi
|
|
||||||
# zipformer
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_librispeech_2022_12_08_zipformer-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_2022_12_08_zipformer:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-zipformer-mmi-2022-12-08.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for librispeech zipformer-mmi
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./zipformer-mmi/exp
|
|
||||||
|
|
||||||
cd zipformer-mmi
|
|
||||||
echo "results for zipformer-mmi"
|
|
||||||
echo "===1best==="
|
|
||||||
find exp/1best -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/1best -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===nbest==="
|
|
||||||
find exp/nbest -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/nbest -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===nbest-rescoring-LG==="
|
|
||||||
find exp/nbest-rescoring-LG -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/nbest-rescoring-LG -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===nbest-rescoring-3-gram==="
|
|
||||||
find exp/nbest-rescoring-3-gram -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/nbest-rescoring-3-gram -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===nbest-rescoring-4-gram==="
|
|
||||||
find exp/nbest-rescoring-4-gram -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/nbest-rescoring-4-gram -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for librispeech zipformer-mmi
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-zipformer_mmi-2022-12-08
|
|
||||||
path: egs/librispeech/ASR/zipformer_mmi/exp/
|
|
||||||
@ -1,172 +0,0 @@
|
|||||||
# Copyright 2022 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-2022-12-29-stateless7-streaming
|
|
||||||
# zipformer
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_librispeech_2022_12_29_zipformer_streaming-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_2022_12_29_zipformer_streaming:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event.label.name == 'streaming-zipformer' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-pruned-transducer-stateless7-streaming-2022-12-29.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for librispeech pruned_transducer_stateless7_streaming
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./pruned_transducer_stateless7_streaming/exp
|
|
||||||
|
|
||||||
cd pruned_transducer_stateless7_streaming
|
|
||||||
echo "results for pruned_transducer_stateless7_streaming"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===streaming greedy search==="
|
|
||||||
find exp/streaming/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/streaming/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===streaming fast_beam_search==="
|
|
||||||
find exp/streaming/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/streaming/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===streaming modified beam search==="
|
|
||||||
find exp/streaming/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/streaming/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
|
|
||||||
- name: Upload decoding results for librispeech pruned_transducer_stateless7_streaming
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-pruned_transducer_stateless7-streaming-2022-12-29
|
|
||||||
path: egs/librispeech/ASR/pruned_transducer_stateless7_streaming/exp/
|
|
||||||
@ -1,163 +0,0 @@
|
|||||||
# Copyright 2022 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-2023-01-29-stateless7-ctc-bs
|
|
||||||
# zipformer
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_2023_01_29_zipformer_ctc_bs:
|
|
||||||
if: github.event.label.name == 'run-decode' || github.event.label.name == 'blank-skip' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-pruned-transducer-stateless7-ctc-bs-2023-01-29.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for librispeech pruned_transducer_stateless7_ctc_bs
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./pruned_transducer_stateless7_ctc_bs/exp
|
|
||||||
|
|
||||||
cd pruned_transducer_stateless7_ctc_bs
|
|
||||||
echo "results for pruned_transducer_stateless7_ctc_bs"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===ctc decoding==="
|
|
||||||
find exp/ctc-decoding -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/ctc-decoding -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===1best==="
|
|
||||||
find exp/1best -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/1best -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for librispeech pruned_transducer_stateless7_ctc_bs
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-pruned_transducer_stateless7-ctc-bs-2023-01-29
|
|
||||||
path: egs/librispeech/ASR/pruned_transducer_stateless7_ctc_bs/exp/
|
|
||||||
@ -1,155 +0,0 @@
|
|||||||
# Copyright 2022 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-conformer-ctc3-2022-11-28
|
|
||||||
# zipformer
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_librispeech_2022_11_28_conformer_ctc3-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_2022_11_28_conformer_ctc3:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-conformer-ctc3-2022-11-28.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for librispeech conformer_ctc3
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./conformer_ctc3/exp
|
|
||||||
|
|
||||||
cd conformer_ctc3
|
|
||||||
echo "results for conformer_ctc3"
|
|
||||||
echo "===ctc-decoding==="
|
|
||||||
find exp/ctc-decoding -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/ctc-decoding -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===1best==="
|
|
||||||
find exp/1best -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/1best -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for librispeech conformer_ctc3
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-conformer_ctc3-2022-11-28
|
|
||||||
path: egs/librispeech/ASR/conformer_ctc3/exp/
|
|
||||||
@ -16,6 +16,8 @@ on:
|
|||||||
# nightly build at 15:50 UTC time every day
|
# nightly build at 15:50 UTC time every day
|
||||||
- cron: "50 15 * * *"
|
- cron: "50 15 * * *"
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: run_librispeech_lstm_transducer_stateless2_2022_09_03-${{ github.ref }}
|
group: run_librispeech_lstm_transducer_stateless2_2022_09_03-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@ -156,7 +158,7 @@ jobs:
|
|||||||
find modified_beam_search_LODR -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
find modified_beam_search_LODR -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
||||||
|
|
||||||
- name: Upload decoding results for lstm_transducer_stateless2
|
- name: Upload decoding results for lstm_transducer_stateless2
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'shallow-fusion' || github.event.label.name == 'LODR'
|
if: github.event_name == 'schedule' || github.event.label.name == 'shallow-fusion' || github.event.label.name == 'LODR'
|
||||||
with:
|
with:
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-lstm_transducer_stateless2-2022-09-03
|
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-lstm_transducer_stateless2-2022-09-03
|
||||||
|
|||||||
@ -1,157 +0,0 @@
|
|||||||
# Copyright 2021 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-pruned-transducer-stateless3-2022-05-13
|
|
||||||
# stateless pruned transducer (reworked model) + giga speech
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_librispeech_pruned_transducer_stateless3_2022_05_13-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_pruned_transducer_stateless3_2022_05_13:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-pruned-transducer-stateless3-2022-05-13.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for pruned_transducer_stateless3
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR
|
|
||||||
tree pruned_transducer_stateless3/exp
|
|
||||||
cd pruned_transducer_stateless3/exp
|
|
||||||
echo "===greedy search==="
|
|
||||||
find greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for pruned_transducer_stateless3
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-pruned_transducer_stateless3-2022-04-29
|
|
||||||
path: egs/librispeech/ASR/pruned_transducer_stateless3/exp/
|
|
||||||
@ -1,159 +0,0 @@
|
|||||||
# Copyright 2021 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-streaming-2022-06-26
|
|
||||||
# streaming conformer stateless transducer2
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_librispeech_streaming_2022_06_26-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_streaming_2022_06_26:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-streaming-pruned-transducer-stateless2-2022-06-26.sh
|
|
||||||
|
|
||||||
- name: Display decoding results
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./pruned_transducer_stateless2/exp
|
|
||||||
|
|
||||||
cd pruned_transducer_stateless2
|
|
||||||
echo "results for pruned_transducer_stateless2"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified_beam_search==="
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for pruned_transducer_stateless2
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-pruned_transducer_stateless2-2022-06-26
|
|
||||||
path: egs/librispeech/ASR/pruned_transducer_stateless2/exp/
|
|
||||||
@ -1,174 +0,0 @@
|
|||||||
# Copyright 2022 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-streaming-zipformer-2023-05-18
|
|
||||||
# zipformer
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_librispeech_2023_05_18_streaming_zipformer-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_2023_05_18_streaming_zipformer:
|
|
||||||
if: github.event.label.name == 'zipformer' ||github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-streaming-zipformer-2023-05-18.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for librispeech zipformer
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./zipformer/exp
|
|
||||||
|
|
||||||
cd zipformer
|
|
||||||
|
|
||||||
echo "results for zipformer, simulated streaming decoding"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "results for zipformer, chunk-wise streaming decoding"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/streaming/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/streaming/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/streaming/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/streaming/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find exp/streaming/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/streaming/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
|
|
||||||
- name: Upload decoding results for librispeech zipformer
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-zipformer-2022-11-11
|
|
||||||
path: egs/librispeech/ASR/zipformer/exp/
|
|
||||||
@ -1,159 +0,0 @@
|
|||||||
# Copyright 2021 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-2022-04-19
|
|
||||||
# stateless transducer + torchaudio rnn-t loss
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_librispeech_2022_04_19-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_2022_04_19:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-transducer-stateless2-2022-04-19.sh
|
|
||||||
|
|
||||||
- name: Display decoding results
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./transducer_stateless2/exp
|
|
||||||
|
|
||||||
cd transducer_stateless2
|
|
||||||
echo "results for transducer_stateless2"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified_beam_search==="
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for transducer_stateless2
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-transducer_stateless2-2022-04-19
|
|
||||||
path: egs/librispeech/ASR/transducer_stateless2/exp/
|
|
||||||
@ -1,155 +0,0 @@
|
|||||||
# Copyright 2022 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-librispeech-zipformer-ctc-2023-06-14
|
|
||||||
# zipformer
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_librispeech_2023_06_14_zipformer-ctc-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_librispeech_2023_06_14_zipformer_ctc:
|
|
||||||
if: github.event.label.name == 'zipformer' ||github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-librispeech-zipformer-ctc-2023-06-14.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for librispeech zipformer
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./zipformer/exp
|
|
||||||
|
|
||||||
cd zipformer
|
|
||||||
echo "results for zipformer"
|
|
||||||
echo "===ctc-decoding==="
|
|
||||||
find exp/ctc-decoding -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/ctc-decoding -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===1best==="
|
|
||||||
find exp/1best -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/1best -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for librispeech zipformer
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-zipformer-2022-11-11
|
|
||||||
path: egs/librispeech/ASR/zipformer/exp/
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
# Copyright 2021 Fangjun Kuang (csukuangfj@gmail.com)
|
# Copyright 2023 Xiaomi Corp. (author: Zengrui Jin)
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
# See ../../LICENSE for clarification regarding multiple authors
|
||||||
#
|
#
|
||||||
@ -14,7 +14,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
name: run-pre-trained-ctc
|
name: run-multi-corpora-zipformer
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -24,19 +24,14 @@ on:
|
|||||||
types: [labeled]
|
types: [labeled]
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
test-run:
|
|
||||||
description: 'Test (y/n)?'
|
|
||||||
required: true
|
|
||||||
default: 'y'
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: run_pre_trained_ctc-${{ github.ref }}
|
group: run_multi-corpora_zipformer-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run_pre_trained_ctc:
|
run_multi-corpora_zipformer:
|
||||||
if: github.event.label.name == 'ready' || github.event_name == 'push' || github.event.inputs.test-run == 'y' || github.event.label.name == 'ctc'
|
if: github.event.label.name == 'onnx' || github.event.label.name == 'ready' || github.event_name == 'push' || github.event.label.name == 'multi-zh_hans' || github.event.label.name == 'zipformer' || github.event.label.name == 'multi-corpora'
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -79,9 +74,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Inference with pre-trained model
|
- name: Inference with pre-trained model
|
||||||
shell: bash
|
shell: bash
|
||||||
|
env:
|
||||||
|
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
||||||
|
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get -qq install git-lfs tree
|
sudo apt-get -qq install git-lfs tree
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
export PYTHONPATH=$PWD:$PYTHONPATH
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
||||||
.github/scripts/run-pre-trained-ctc.sh
|
|
||||||
|
.github/scripts/run-multi-corpora-zipformer.sh
|
||||||
@ -1,158 +0,0 @@
|
|||||||
# Copyright 2021 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-pre-trained-trandsucer-stateless-multi-datasets-librispeech-100h
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_pre_trained_transducer_stateless_multi_datasets_librispeech_100h-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_pre_trained_transducer_stateless_multi_datasets_librispeech_100h:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-pre-trained-transducer-stateless-librispeech-100h.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for transducer_stateless_multi_datasets
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./transducer_stateless_multi_datasets/exp
|
|
||||||
|
|
||||||
cd transducer_stateless_multi_datasets
|
|
||||||
echo "results for transducer_stateless_multi_datasets"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for transducer_stateless_multi_datasets
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-transducer_stateless_multi_datasets-100h-2022-02-21
|
|
||||||
path: egs/librispeech/ASR/transducer_stateless_multi_datasets/exp/
|
|
||||||
@ -1,158 +0,0 @@
|
|||||||
# Copyright 2021 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-pre-trained-trandsucer-stateless-multi-datasets-librispeech-960h
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_pre_trained_transducer_stateless_multi_datasets_librispeech_960h-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_pre_trained_transducer_stateless_multi_datasets_librispeech_960h:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-pre-trained-transducer-stateless-librispeech-960h.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for transducer_stateless_multi_datasets
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./transducer_stateless_multi_datasets/exp
|
|
||||||
|
|
||||||
cd transducer_stateless_multi_datasets
|
|
||||||
echo "results for transducer_stateless_multi_datasets"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for transducer_stateless_multi_datasets
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-transducer_stateless_multi_datasets-100h-2022-03-01
|
|
||||||
path: egs/librispeech/ASR/transducer_stateless_multi_datasets/exp/
|
|
||||||
@ -1,80 +0,0 @@
|
|||||||
# Copyright 2021 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-pre-trained-trandsucer-stateless-modified-2-aishell
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_pre_trained_transducer_stateless_modified_2_aishell-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_pre_trained_transducer_stateless_modified_2_aishell:
|
|
||||||
if: github.event.label.name == 'ready' || github.event_name == 'push'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
.github/scripts/run-pre-trained-transducer-stateless-modified-2-aishell.sh
|
|
||||||
@ -1,80 +0,0 @@
|
|||||||
# Copyright 2021 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-pre-trained-trandsucer-stateless-modified-aishell
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_pre_trained_transducer_stateless_modified_aishell-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_pre_trained_transducer_stateless_modified_aishell:
|
|
||||||
if: github.event.label.name == 'ready' || github.event_name == 'push'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
.github/scripts/run-pre-trained-transducer-stateless-modified-aishell.sh
|
|
||||||
@ -1,158 +0,0 @@
|
|||||||
# Copyright 2021 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-pre-trained-transducer-stateless
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
# minute (0-59)
|
|
||||||
# hour (0-23)
|
|
||||||
# day of the month (1-31)
|
|
||||||
# month (1-12)
|
|
||||||
# day of the week (0-6)
|
|
||||||
# nightly build at 15:50 UTC time every day
|
|
||||||
- cron: "50 15 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run_pre_trained_transducer_stateless-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run_pre_trained_transducer_stateless:
|
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'run-decode' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
- name: Cache kaldifeat
|
|
||||||
id: my-cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/kaldifeat
|
|
||||||
key: cache-tmp-${{ matrix.python-version }}-2023-05-22
|
|
||||||
|
|
||||||
- name: Install kaldifeat
|
|
||||||
if: steps.my-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/install-kaldifeat.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other datasets
|
|
||||||
id: libri-test-clean-and-test-other-data
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/download
|
|
||||||
key: cache-libri-test-clean-and-test-other
|
|
||||||
|
|
||||||
- name: Download LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-data.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/download-librispeech-test-clean-and-test-other-dataset.sh
|
|
||||||
|
|
||||||
- name: Prepare manifests for LibriSpeech test-clean and test-other
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/prepare-librispeech-test-clean-and-test-other-manifests.sh
|
|
||||||
|
|
||||||
- name: Cache LibriSpeech test-clean and test-other fbank features
|
|
||||||
id: libri-test-clean-and-test-other-fbank
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/tmp/fbank-libri
|
|
||||||
key: cache-libri-fbank-test-clean-and-test-other-v2
|
|
||||||
|
|
||||||
- name: Compute fbank for LibriSpeech test-clean and test-other
|
|
||||||
if: steps.libri-test-clean-and-test-other-fbank.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
.github/scripts/compute-fbank-librispeech-test-clean-and-test-other.sh
|
|
||||||
|
|
||||||
- name: Inference with pre-trained model
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
||||||
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
|
||||||
run: |
|
|
||||||
mkdir -p egs/librispeech/ASR/data
|
|
||||||
ln -sfv ~/tmp/fbank-libri egs/librispeech/ASR/data/fbank
|
|
||||||
ls -lh egs/librispeech/ASR/data/*
|
|
||||||
|
|
||||||
sudo apt-get -qq install git-lfs tree
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
.github/scripts/run-pre-trained-transducer-stateless.sh
|
|
||||||
|
|
||||||
- name: Display decoding results for transducer_stateless
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd egs/librispeech/ASR/
|
|
||||||
tree ./transducer_stateless/exp
|
|
||||||
|
|
||||||
cd transducer_stateless
|
|
||||||
echo "results for transducer_stateless"
|
|
||||||
echo "===greedy search==="
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/greedy_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===fast_beam_search==="
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/fast_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
echo "===modified beam search==="
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-clean" {} + | sort -n -k2
|
|
||||||
find exp/modified_beam_search -name "log-*" -exec grep -n --color "best for test-other" {} + | sort -n -k2
|
|
||||||
|
|
||||||
- name: Upload decoding results for transducer_stateless
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
if: github.event_name == 'schedule' || github.event.label.name == 'run-decode'
|
|
||||||
with:
|
|
||||||
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-ubuntu-latest-cpu-transducer_stateless-2022-02-07
|
|
||||||
path: egs/librispeech/ASR/transducer_stateless/exp/
|
|
||||||
4
.github/workflows/run-ptb-rnn-lm.yml
vendored
4
.github/workflows/run-ptb-rnn-lm.yml
vendored
@ -16,6 +16,8 @@ on:
|
|||||||
# nightly build at 15:50 UTC time every day
|
# nightly build at 15:50 UTC time every day
|
||||||
- cron: "50 15 * * *"
|
- cron: "50 15 * * *"
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: run_ptb_rnn_lm_training-${{ github.ref }}
|
group: run_ptb_rnn_lm_training-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@ -64,7 +66,7 @@ jobs:
|
|||||||
./train-rnn-lm.sh --world-size 1 --num-epochs 5 --use-epoch 4 --use-avg 2
|
./train-rnn-lm.sh --world-size 1 --num-epochs 5 --use-epoch 4 --use-avg 2
|
||||||
|
|
||||||
- name: Upload pretrained models
|
- name: Upload pretrained models
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
if: github.event.label.name == 'ready' || github.event.label.name == 'rnnlm' || github.event_name == 'push' || github.event_name == 'schedule'
|
if: github.event.label.name == 'ready' || github.event.label.name == 'rnnlm' || github.event_name == 'push' || github.event_name == 'schedule'
|
||||||
with:
|
with:
|
||||||
name: python-${{ matrix.python-version }}-ubuntu-rnn-lm-ptb
|
name: python-${{ matrix.python-version }}-ubuntu-rnn-lm-ptb
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
name: run-multi-zh_hans-zipformer
|
name: run-swbd-conformer_ctc
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -23,13 +23,15 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
types: [labeled]
|
types: [labeled]
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: run_multi-zh_hans_zipformer-${{ github.ref }}
|
group: run-swbd-conformer_ctc-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run_multi-zh_hans_zipformer:
|
run-swbd-conformer_ctc:
|
||||||
if: github.event.label.name == 'onnx' || github.event.label.name == 'ready' || github.event_name == 'push' || github.event.label.name == 'multi-zh_hans'
|
if: github.event.label.name == 'onnx' || github.event.label.name == 'ready' || github.event_name == 'push' || github.event.label.name == 'swbd'
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -81,4 +83,4 @@ jobs:
|
|||||||
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH
|
||||||
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH
|
||||||
|
|
||||||
.github/scripts/run-multi-zh_hans-zipformer.sh
|
.github/scripts/run-swbd-conformer-ctc-2023-08-26.sh
|
||||||
@ -23,6 +23,8 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
types: [labeled]
|
types: [labeled]
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: run_wenetspeech_pruned_transducer_stateless2-${{ github.ref }}
|
group: run_wenetspeech_pruned_transducer_stateless2-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|||||||
185
.github/workflows/run-yesno-recipe.yml
vendored
185
.github/workflows/run-yesno-recipe.yml
vendored
@ -1,185 +0,0 @@
|
|||||||
# Copyright 2021 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: run-yesno-recipe
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: run-yesno-recipe-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run-yesno-recipe:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
# os: [ubuntu-latest, macos-10.15]
|
|
||||||
# TODO: enable macOS for CPU testing
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: [3.8]
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: '**/requirements-ci.txt'
|
|
||||||
|
|
||||||
- name: Install libnsdfile and libsox
|
|
||||||
if: startsWith(matrix.os, 'ubuntu')
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -q -y libsndfile1-dev libsndfile1 ffmpeg
|
|
||||||
sudo apt install -q -y --fix-missing sox libsox-dev libsox-fmt-all
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
grep -v '^#' ./requirements-ci.txt | xargs -n 1 -L 1 pip install
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
pip install --no-deps --force-reinstall https://huggingface.co/csukuangfj/k2/resolve/main/cpu/k2-1.24.3.dev20230508+cpu.torch1.13.1-cp38-cp38-linux_x86_64.whl
|
|
||||||
pip install kaldifeat==1.25.0.dev20230726+cpu.torch1.13.1 -f https://csukuangfj.github.io/kaldifeat/cpu.html
|
|
||||||
|
|
||||||
- name: Run yesno recipe
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{github.workspace}}
|
|
||||||
run: |
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
echo $PYTHONPATH
|
|
||||||
|
|
||||||
cd egs/yesno/ASR
|
|
||||||
./prepare.sh
|
|
||||||
python3 ./tdnn/train.py
|
|
||||||
python3 ./tdnn/decode.py
|
|
||||||
|
|
||||||
- name: Test exporting to pretrained.pt
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{github.workspace}}
|
|
||||||
run: |
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
echo $PYTHONPATH
|
|
||||||
|
|
||||||
cd egs/yesno/ASR
|
|
||||||
python3 ./tdnn/export.py --epoch 14 --avg 2
|
|
||||||
|
|
||||||
python3 ./tdnn/pretrained.py \
|
|
||||||
--checkpoint ./tdnn/exp/pretrained.pt \
|
|
||||||
--HLG ./data/lang_phone/HLG.pt \
|
|
||||||
--words-file ./data/lang_phone/words.txt \
|
|
||||||
download/waves_yesno/0_0_0_1_0_0_0_1.wav \
|
|
||||||
download/waves_yesno/0_0_1_0_0_0_1_0.wav
|
|
||||||
|
|
||||||
- name: Test exporting to torchscript
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{github.workspace}}
|
|
||||||
run: |
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
echo $PYTHONPATH
|
|
||||||
|
|
||||||
cd egs/yesno/ASR
|
|
||||||
python3 ./tdnn/export.py --epoch 14 --avg 2 --jit 1
|
|
||||||
|
|
||||||
python3 ./tdnn/jit_pretrained.py \
|
|
||||||
--nn-model ./tdnn/exp/cpu_jit.pt \
|
|
||||||
--HLG ./data/lang_phone/HLG.pt \
|
|
||||||
--words-file ./data/lang_phone/words.txt \
|
|
||||||
download/waves_yesno/0_0_0_1_0_0_0_1.wav \
|
|
||||||
download/waves_yesno/0_0_1_0_0_0_1_0.wav
|
|
||||||
|
|
||||||
- name: Test exporting to onnx
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{github.workspace}}
|
|
||||||
run: |
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
echo $PYTHONPATH
|
|
||||||
|
|
||||||
cd egs/yesno/ASR
|
|
||||||
python3 ./tdnn/export_onnx.py --epoch 14 --avg 2
|
|
||||||
|
|
||||||
echo "Test float32 model"
|
|
||||||
python3 ./tdnn/onnx_pretrained.py \
|
|
||||||
--nn-model ./tdnn/exp/model-epoch-14-avg-2.onnx \
|
|
||||||
--HLG ./data/lang_phone/HLG.pt \
|
|
||||||
--words-file ./data/lang_phone/words.txt \
|
|
||||||
download/waves_yesno/0_0_0_1_0_0_0_1.wav \
|
|
||||||
download/waves_yesno/0_0_1_0_0_0_1_0.wav
|
|
||||||
|
|
||||||
|
|
||||||
echo "Test int8 model"
|
|
||||||
python3 ./tdnn/onnx_pretrained.py \
|
|
||||||
--nn-model ./tdnn/exp/model-epoch-14-avg-2.int8.onnx \
|
|
||||||
--HLG ./data/lang_phone/HLG.pt \
|
|
||||||
--words-file ./data/lang_phone/words.txt \
|
|
||||||
download/waves_yesno/0_0_0_1_0_0_0_1.wav \
|
|
||||||
download/waves_yesno/0_0_1_0_0_0_1_0.wav
|
|
||||||
|
|
||||||
- name: Test decoding with H
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{github.workspace}}
|
|
||||||
run: |
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
echo $PYTHONPATH
|
|
||||||
|
|
||||||
cd egs/yesno/ASR
|
|
||||||
python3 ./tdnn/export.py --epoch 14 --avg 2 --jit 1
|
|
||||||
|
|
||||||
python3 ./tdnn/jit_pretrained_decode_with_H.py \
|
|
||||||
--nn-model ./tdnn/exp/cpu_jit.pt \
|
|
||||||
--H ./data/lang_phone/H.fst \
|
|
||||||
--tokens ./data/lang_phone/tokens.txt \
|
|
||||||
./download/waves_yesno/0_0_0_1_0_0_0_1.wav \
|
|
||||||
./download/waves_yesno/0_0_1_0_0_0_1_0.wav \
|
|
||||||
./download/waves_yesno/0_0_1_0_0_1_1_1.wav
|
|
||||||
|
|
||||||
- name: Test decoding with HL
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{github.workspace}}
|
|
||||||
run: |
|
|
||||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
|
||||||
echo $PYTHONPATH
|
|
||||||
|
|
||||||
cd egs/yesno/ASR
|
|
||||||
python3 ./tdnn/export.py --epoch 14 --avg 2 --jit 1
|
|
||||||
|
|
||||||
python3 ./tdnn/jit_pretrained_decode_with_HL.py \
|
|
||||||
--nn-model ./tdnn/exp/cpu_jit.pt \
|
|
||||||
--HL ./data/lang_phone/HL.fst \
|
|
||||||
--words ./data/lang_phone/words.txt \
|
|
||||||
./download/waves_yesno/0_0_0_1_0_0_0_1.wav \
|
|
||||||
./download/waves_yesno/0_0_1_0_0_0_1_0.wav \
|
|
||||||
./download/waves_yesno/0_0_1_0_0_1_1_1.wav
|
|
||||||
|
|
||||||
- name: Show generated files
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{github.workspace}}
|
|
||||||
run: |
|
|
||||||
cd egs/yesno/ASR
|
|
||||||
ls -lh tdnn/exp
|
|
||||||
ls -lh data/lang_phone
|
|
||||||
10
.github/workflows/style_check.yml
vendored
10
.github/workflows/style_check.yml
vendored
@ -24,6 +24,8 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: style_check-${{ github.ref }}
|
group: style_check-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@ -49,7 +51,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Python dependencies
|
- name: Install Python dependencies
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install --upgrade pip black==22.3.0 flake8==5.0.4 click==8.1.0
|
python3 -m pip install --upgrade pip black==22.3.0 flake8==5.0.4 click==8.1.0 isort==5.10.1
|
||||||
# Click issue fixed in https://github.com/psf/black/pull/2966
|
# Click issue fixed in https://github.com/psf/black/pull/2966
|
||||||
|
|
||||||
- name: Run flake8
|
- name: Run flake8
|
||||||
@ -67,3 +69,9 @@ jobs:
|
|||||||
working-directory: ${{github.workspace}}
|
working-directory: ${{github.workspace}}
|
||||||
run: |
|
run: |
|
||||||
black --check --diff .
|
black --check --diff .
|
||||||
|
|
||||||
|
- name: Run isort
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{github.workspace}}
|
||||||
|
run: |
|
||||||
|
isort --check --diff .
|
||||||
|
|||||||
2
.github/workflows/test-ncnn-export.yml
vendored
2
.github/workflows/test-ncnn-export.yml
vendored
@ -16,6 +16,8 @@ on:
|
|||||||
# nightly build at 15:50 UTC time every day
|
# nightly build at 15:50 UTC time every day
|
||||||
- cron: "50 15 * * *"
|
- cron: "50 15 * * *"
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: test_ncnn_export-${{ github.ref }}
|
group: test_ncnn_export-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|||||||
2
.github/workflows/test-onnx-export.yml
vendored
2
.github/workflows/test-onnx-export.yml
vendored
@ -16,6 +16,8 @@ on:
|
|||||||
# nightly build at 15:50 UTC time every day
|
# nightly build at 15:50 UTC time every day
|
||||||
- cron: "50 15 * * *"
|
- cron: "50 15 * * *"
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: test_onnx_export-${{ github.ref }}
|
group: test_onnx_export-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|||||||
162
.github/workflows/test.yml
vendored
162
.github/workflows/test.yml
vendored
@ -1,131 +1,111 @@
|
|||||||
# Copyright 2021 Fangjun Kuang (csukuangfj@gmail.com)
|
|
||||||
|
|
||||||
# See ../../LICENSE for clarification regarding multiple authors
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
name: test
|
name: test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: test-${{ github.ref }}
|
group: test-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
generate_build_matrix:
|
||||||
|
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
|
||||||
|
# see https://github.com/pytorch/pytorch/pull/50633
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Generating build matrix
|
||||||
|
id: set-matrix
|
||||||
|
run: |
|
||||||
|
# outputting for debugging purposes
|
||||||
|
python ./.github/scripts/docker/generate_build_matrix.py
|
||||||
|
MATRIX=$(python ./.github/scripts/docker/generate_build_matrix.py)
|
||||||
|
echo "::set-output name=matrix::${MATRIX}"
|
||||||
test:
|
test:
|
||||||
runs-on: ${{ matrix.os }}
|
needs: generate_build_matrix
|
||||||
|
name: py${{ matrix.python-version }} torch${{ matrix.torch-version }} v${{ matrix.version }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
python-version: ["3.8"]
|
|
||||||
torch: ["1.13.0"]
|
|
||||||
torchaudio: ["0.13.0"]
|
|
||||||
k2-version: ["1.24.3.dev20230719"]
|
|
||||||
|
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }}
|
- name: Free space
|
||||||
uses: actions/setup-python@v1
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
|
|
||||||
- name: Install libnsdfile and libsox
|
|
||||||
if: startsWith(matrix.os, 'ubuntu')
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -q -y libsndfile1-dev libsndfile1 ffmpeg
|
|
||||||
sudo apt install -q -y --fix-missing libsox-dev libsox-fmt-all
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
|
||||||
run: |
|
|
||||||
python3 -m pip install --upgrade pip pytest
|
|
||||||
# numpy 1.20.x does not support python 3.6
|
|
||||||
pip install numpy==1.19
|
|
||||||
pip install torch==${{ matrix.torch }}+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
|
|
||||||
pip install torchaudio==${{ matrix.torchaudio }}+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
|
|
||||||
|
|
||||||
pip install k2==${{ matrix.k2-version }}+cpu.torch${{ matrix.torch }} -f https://k2-fsa.github.io/k2/cpu.html
|
|
||||||
pip install git+https://github.com/lhotse-speech/lhotse
|
|
||||||
# icefall requirements
|
|
||||||
pip uninstall -y protobuf
|
|
||||||
pip install --no-binary protobuf protobuf==3.20.*
|
|
||||||
|
|
||||||
pip install kaldifst
|
|
||||||
pip install onnxruntime matplotlib
|
|
||||||
pip install -r requirements.txt
|
|
||||||
|
|
||||||
- name: Install graphviz
|
|
||||||
if: startsWith(matrix.os, 'ubuntu')
|
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install -qq graphviz
|
df -h
|
||||||
sudo apt-get -qq install graphviz
|
rm -rf /opt/hostedtoolcache
|
||||||
|
df -h
|
||||||
|
echo "pwd: $PWD"
|
||||||
|
echo "github.workspace ${{ github.workspace }}"
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
if: startsWith(matrix.os, 'ubuntu')
|
uses: addnab/docker-run-action@v3
|
||||||
run: |
|
with:
|
||||||
ls -lh
|
image: ghcr.io/${{ github.repository_owner }}/icefall:cpu-py${{ matrix.python-version }}-torch${{ matrix.torch-version }}-v${{ matrix.version }}
|
||||||
export PYTHONPATH=$PWD:$PWD/lhotse:$PYTHONPATH
|
options: |
|
||||||
echo $PYTHONPATH
|
--volume ${{ github.workspace }}/:/icefall
|
||||||
pytest -v -s ./test
|
shell: bash
|
||||||
# runt tests for conformer ctc
|
run: |
|
||||||
cd egs/librispeech/ASR/conformer_ctc
|
export PYTHONPATH=/icefall:$PYTHONPATH
|
||||||
pytest -v -s
|
cd /icefall
|
||||||
|
git config --global --add safe.directory /icefall
|
||||||
|
|
||||||
cd ../pruned_transducer_stateless
|
pytest -v -s ./test
|
||||||
pytest -v -s
|
|
||||||
|
|
||||||
cd ../pruned_transducer_stateless2
|
# runt tests for conformer ctc
|
||||||
pytest -v -s
|
cd egs/librispeech/ASR/conformer_ctc
|
||||||
|
pytest -v -s
|
||||||
|
|
||||||
cd ../pruned_transducer_stateless3
|
cd ../pruned_transducer_stateless
|
||||||
pytest -v -s
|
pytest -v -s
|
||||||
|
|
||||||
cd ../pruned_transducer_stateless4
|
cd ../pruned_transducer_stateless2
|
||||||
pytest -v -s
|
pytest -v -s
|
||||||
|
|
||||||
echo $PYTHONPATH
|
cd ../pruned_transducer_stateless3
|
||||||
cd ../pruned_transducer_stateless7
|
pytest -v -s
|
||||||
pytest -v -s
|
|
||||||
|
|
||||||
cd ../transducer_stateless
|
cd ../pruned_transducer_stateless4
|
||||||
pytest -v -s
|
pytest -v -s
|
||||||
|
|
||||||
# cd ../transducer
|
echo $PYTHONPATH
|
||||||
# pytest -v -s
|
cd ../pruned_transducer_stateless7
|
||||||
|
pytest -v -s
|
||||||
|
|
||||||
cd ../transducer_stateless2
|
cd ../transducer_stateless
|
||||||
pytest -v -s
|
pytest -v -s
|
||||||
|
|
||||||
cd ../transducer_lstm
|
# cd ../transducer
|
||||||
pytest -v -s
|
# pytest -v -s
|
||||||
|
|
||||||
cd ../zipformer
|
cd ../transducer_stateless2
|
||||||
pytest -v -s
|
pytest -v -s
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
cd ../transducer_lstm
|
||||||
|
pytest -v -s
|
||||||
|
|
||||||
|
cd ../zipformer
|
||||||
|
pytest -v -s
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: egs/librispeech/ASR/zipformer/swoosh.pdf
|
path: egs/librispeech/ASR/zipformer/swoosh.pdf
|
||||||
name: swoosh.pdf
|
name: swoosh-${{ matrix.python-version }}-${{ matrix.torch-version }}
|
||||||
|
|||||||
65
.github/workflows/yesno.yml
vendored
Normal file
65
.github/workflows/yesno.yml
vendored
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
name: yesno
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: yesno-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate_build_matrix:
|
||||||
|
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
|
||||||
|
# see https://github.com/pytorch/pytorch/pull/50633
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Generating build matrix
|
||||||
|
id: set-matrix
|
||||||
|
run: |
|
||||||
|
# outputting for debugging purposes
|
||||||
|
python ./.github/scripts/docker/generate_build_matrix.py
|
||||||
|
MATRIX=$(python ./.github/scripts/docker/generate_build_matrix.py)
|
||||||
|
echo "::set-output name=matrix::${MATRIX}"
|
||||||
|
yesno:
|
||||||
|
needs: generate_build_matrix
|
||||||
|
name: py${{ matrix.python-version }} torch${{ matrix.torch-version }} v${{ matrix.version }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Run the yesno recipe
|
||||||
|
uses: addnab/docker-run-action@v3
|
||||||
|
with:
|
||||||
|
image: ghcr.io/${{ github.repository_owner }}/icefall:cpu-py${{ matrix.python-version }}-torch${{ matrix.torch-version }}-v${{ matrix.version }}
|
||||||
|
options: |
|
||||||
|
--volume ${{ github.workspace }}/:/icefall
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
export PYTHONPATH=/icefall:$PYTHONPATH
|
||||||
|
cd /icefall
|
||||||
|
git config --global --add safe.directory /icefall
|
||||||
|
|
||||||
|
python3 -m torch.utils.collect_env
|
||||||
|
python3 -m k2.version
|
||||||
|
|
||||||
|
.github/scripts/yesno/ASR/run.sh
|
||||||
@ -26,7 +26,7 @@ repos:
|
|||||||
# E121,E123,E126,E226,E24,E704,W503,W504
|
# E121,E123,E126,E226,E24,E704,W503,W504
|
||||||
|
|
||||||
- repo: https://github.com/pycqa/isort
|
- repo: https://github.com/pycqa/isort
|
||||||
rev: 5.11.5
|
rev: 5.12.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
args: ["--profile=black"]
|
args: ["--profile=black"]
|
||||||
|
|||||||
448
README.md
448
README.md
@ -2,44 +2,86 @@
|
|||||||
<img src="https://raw.githubusercontent.com/k2-fsa/icefall/master/docs/source/_static/logo.png" width=168>
|
<img src="https://raw.githubusercontent.com/k2-fsa/icefall/master/docs/source/_static/logo.png" width=168>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## Introduction
|
# Introduction
|
||||||
|
|
||||||
icefall contains ASR recipes for various datasets
|
The icefall project contains speech-related recipes for various datasets
|
||||||
using <https://github.com/k2-fsa/k2>.
|
using [k2-fsa](https://github.com/k2-fsa/k2) and [lhotse](https://github.com/lhotse-speech/lhotse).
|
||||||
|
|
||||||
You can use <https://github.com/k2-fsa/sherpa> to deploy models
|
You can use [sherpa](https://github.com/k2-fsa/sherpa), [sherpa-ncnn](https://github.com/k2-fsa/sherpa-ncnn) or [sherpa-onnx](https://github.com/k2-fsa/sherpa-onnx) for deployment with models
|
||||||
trained with icefall.
|
in icefall; these frameworks also support models not included in icefall; please refer to respective documents for more details.
|
||||||
|
|
||||||
You can try pre-trained models from within your browser without the need
|
You can try pre-trained models from within your browser without the need
|
||||||
to download or install anything by visiting <https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition>
|
to download or install anything by visiting this [huggingface space](https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition).
|
||||||
See <https://k2-fsa.github.io/icefall/huggingface/spaces.html> for more details.
|
Please refer to [document](https://k2-fsa.github.io/icefall/huggingface/spaces.html) for more details.
|
||||||
|
|
||||||
## Installation
|
# Installation
|
||||||
|
|
||||||
Please refer to <https://icefall.readthedocs.io/en/latest/installation/index.html>
|
Please refer to [document](https://k2-fsa.github.io/icefall/installation/index.html)
|
||||||
for installation.
|
for installation.
|
||||||
|
|
||||||
## Recipes
|
# Recipes
|
||||||
|
|
||||||
Please refer to <https://icefall.readthedocs.io/en/latest/recipes/index.html>
|
Please refer to [document](https://k2-fsa.github.io/icefall/recipes/index.html)
|
||||||
for more information.
|
for more details.
|
||||||
|
|
||||||
We provide the following recipes:
|
## ASR: Automatic Speech Recognition
|
||||||
|
|
||||||
|
### Supported Datasets
|
||||||
- [yesno][yesno]
|
- [yesno][yesno]
|
||||||
- [LibriSpeech][librispeech]
|
|
||||||
- [GigaSpeech][gigaspeech]
|
- [Aidatatang_200zh][aidatatang_200zh]
|
||||||
- [Aishell][aishell]
|
- [Aishell][aishell]
|
||||||
- [Aishell2][aishell2]
|
- [Aishell2][aishell2]
|
||||||
- [Aishell4][aishell4]
|
- [Aishell4][aishell4]
|
||||||
|
- [Alimeeting][alimeeting]
|
||||||
|
- [AMI][ami]
|
||||||
|
- [CommonVoice][commonvoice]
|
||||||
|
- [Corpus of Spontaneous Japanese][csj]
|
||||||
|
- [GigaSpeech][gigaspeech]
|
||||||
|
- [LibriCSS][libricss]
|
||||||
|
- [LibriSpeech][librispeech]
|
||||||
|
- [Libriheavy][libriheavy]
|
||||||
|
- [Multi-Dialect Broadcast News Arabic Speech Recognition][mgb2]
|
||||||
|
- [PeopleSpeech][peoplespeech]
|
||||||
|
- [SPGISpeech][spgispeech]
|
||||||
|
- [Switchboard][swbd]
|
||||||
- [TIMIT][timit]
|
- [TIMIT][timit]
|
||||||
- [TED-LIUM3][tedlium3]
|
- [TED-LIUM3][tedlium3]
|
||||||
- [Aidatatang_200zh][aidatatang_200zh]
|
|
||||||
- [WenetSpeech][wenetspeech]
|
|
||||||
- [Alimeeting][alimeeting]
|
|
||||||
- [TAL_CSASR][tal_csasr]
|
- [TAL_CSASR][tal_csasr]
|
||||||
|
- [Voxpopuli][voxpopuli]
|
||||||
|
- [XBMU-AMDO31][xbmu-amdo31]
|
||||||
|
- [WenetSpeech][wenetspeech]
|
||||||
|
|
||||||
|
More datasets will be added in the future.
|
||||||
|
|
||||||
### yesno
|
### Supported Models
|
||||||
|
|
||||||
|
The [LibriSpeech][librispeech] recipe supports the most comprehensive set of models, you are welcome to try them out.
|
||||||
|
|
||||||
|
#### CTC
|
||||||
|
- TDNN LSTM CTC
|
||||||
|
- Conformer CTC
|
||||||
|
- Zipformer CTC
|
||||||
|
|
||||||
|
#### MMI
|
||||||
|
- Conformer MMI
|
||||||
|
- Zipformer MMI
|
||||||
|
|
||||||
|
#### Transducer
|
||||||
|
- Conformer-based Encoder
|
||||||
|
- LSTM-based Encoder
|
||||||
|
- Zipformer-based Encoder
|
||||||
|
- LSTM-based Predictor
|
||||||
|
- [Stateless Predictor](https://research.google/pubs/rnn-transducer-with-stateless-prediction-network/)
|
||||||
|
|
||||||
|
#### Whisper
|
||||||
|
- [OpenAi Whisper](https://arxiv.org/abs/2212.04356) (We support fine-tuning on AiShell-1.)
|
||||||
|
|
||||||
|
If you are willing to contribute to icefall, please refer to [contributing](https://k2-fsa.github.io/icefall/contributing/index.html) for more details.
|
||||||
|
|
||||||
|
We would like to highlight the performance of some of the recipes here.
|
||||||
|
|
||||||
|
### [yesno][yesno]
|
||||||
|
|
||||||
This is the simplest ASR recipe in `icefall` and can be run on CPU.
|
This is the simplest ASR recipe in `icefall` and can be run on CPU.
|
||||||
Training takes less than 30 seconds and gives you the following WER:
|
Training takes less than 30 seconds and gives you the following WER:
|
||||||
@ -50,337 +92,269 @@ Training takes less than 30 seconds and gives you the following WER:
|
|||||||
We provide a Colab notebook for this recipe: [](https://colab.research.google.com/drive/1tIjjzaJc3IvGyKiMCDWO-TSnBgkcuN3B?usp=sharing)
|
We provide a Colab notebook for this recipe: [](https://colab.research.google.com/drive/1tIjjzaJc3IvGyKiMCDWO-TSnBgkcuN3B?usp=sharing)
|
||||||
|
|
||||||
|
|
||||||
### LibriSpeech
|
### [LibriSpeech][librispeech]
|
||||||
|
|
||||||
Please see <https://github.com/k2-fsa/icefall/blob/master/egs/librispeech/ASR/RESULTS.md>
|
Please see [RESULTS.md](https://github.com/k2-fsa/icefall/blob/master/egs/librispeech/ASR/RESULTS.md)
|
||||||
for the **latest** results.
|
for the **latest** results.
|
||||||
|
|
||||||
We provide 5 models for this recipe:
|
#### [Conformer CTC](https://github.com/k2-fsa/icefall/tree/master/egs/librispeech/ASR/conformer_ctc)
|
||||||
|
|
||||||
- [conformer CTC model][LibriSpeech_conformer_ctc]
|
|
||||||
- [TDNN LSTM CTC model][LibriSpeech_tdnn_lstm_ctc]
|
|
||||||
- [Transducer: Conformer encoder + LSTM decoder][LibriSpeech_transducer]
|
|
||||||
- [Transducer: Conformer encoder + Embedding decoder][LibriSpeech_transducer_stateless]
|
|
||||||
- [Transducer: Zipformer encoder + Embedding decoder][LibriSpeech_zipformer]
|
|
||||||
|
|
||||||
#### Conformer CTC Model
|
|
||||||
|
|
||||||
The best WER we currently have is:
|
|
||||||
|
|
||||||
| | test-clean | test-other |
|
| | test-clean | test-other |
|
||||||
|-----|------------|------------|
|
|-----|------------|------------|
|
||||||
| WER | 2.42 | 5.73 |
|
| WER | 2.42 | 5.73 |
|
||||||
|
|
||||||
|
|
||||||
We provide a Colab notebook to run a pre-trained conformer CTC model: [](https://colab.research.google.com/drive/1huyupXAcHsUrKaWfI83iMEJ6J0Nh0213?usp=sharing)
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/1huyupXAcHsUrKaWfI83iMEJ6J0Nh0213?usp=sharing)
|
||||||
|
|
||||||
#### TDNN LSTM CTC Model
|
#### [TDNN LSTM CTC](https://github.com/k2-fsa/icefall/tree/master/egs/librispeech/ASR/tdnn_lstm_ctc)
|
||||||
|
|
||||||
The WER for this model is:
|
|
||||||
|
|
||||||
| | test-clean | test-other |
|
| | test-clean | test-other |
|
||||||
|-----|------------|------------|
|
|-----|------------|------------|
|
||||||
| WER | 6.59 | 17.69 |
|
| WER | 6.59 | 17.69 |
|
||||||
|
|
||||||
We provide a Colab notebook to run a pre-trained TDNN LSTM CTC model: [](https://colab.research.google.com/drive/1-iSfQMp2So-We_Uu49N4AAcMInB72u9z?usp=sharing)
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/1-iSfQMp2So-We_Uu49N4AAcMInB72u9z?usp=sharing)
|
||||||
|
|
||||||
|
|
||||||
#### Transducer: Conformer encoder + LSTM decoder
|
#### [Transducer (Conformer Encoder + LSTM Predictor)](https://github.com/k2-fsa/icefall/tree/master/egs/librispeech/ASR/transducer)
|
||||||
|
|
||||||
Using Conformer as encoder and LSTM as decoder.
|
| | test-clean | test-other |
|
||||||
|
|---------------|------------|------------|
|
||||||
|
| greedy_search | 3.07 | 7.51 |
|
||||||
|
|
||||||
The best WER with greedy search is:
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/1_u6yK9jDkPwG_NLrZMN2XK7Aeq4suMO2?usp=sharing)
|
||||||
|
|
||||||
| | test-clean | test-other |
|
#### [Transducer (Conformer Encoder + Stateless Predictor)](https://github.com/k2-fsa/icefall/tree/master/egs/librispeech/ASR/transducer)
|
||||||
|-----|------------|------------|
|
|
||||||
| WER | 3.07 | 7.51 |
|
|
||||||
|
|
||||||
We provide a Colab notebook to run a pre-trained RNN-T conformer model: [](https://colab.research.google.com/drive/1_u6yK9jDkPwG_NLrZMN2XK7Aeq4suMO2?usp=sharing)
|
| | test-clean | test-other |
|
||||||
|
|---------------------------------------|------------|------------|
|
||||||
#### Transducer: Conformer encoder + Embedding decoder
|
| modified_beam_search (`beam_size=4`) | 2.56 | 6.27 |
|
||||||
|
|
||||||
Using Conformer as encoder. The decoder consists of 1 embedding layer
|
|
||||||
and 1 convolutional layer.
|
|
||||||
|
|
||||||
The best WER using modified beam search with beam size 4 is:
|
|
||||||
|
|
||||||
| | test-clean | test-other |
|
|
||||||
|-----|------------|------------|
|
|
||||||
| WER | 2.56 | 6.27 |
|
|
||||||
|
|
||||||
Note: No auxiliary losses are used in the training and no LMs are used
|
|
||||||
in the decoding.
|
|
||||||
|
|
||||||
We provide a Colab notebook to run a pre-trained transducer conformer + stateless decoder model: [](https://colab.research.google.com/drive/1CO1bXJ-2khDckZIW8zjOPHGSKLHpTDlp?usp=sharing)
|
|
||||||
|
|
||||||
|
|
||||||
#### k2 pruned RNN-T
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/1CO1bXJ-2khDckZIW8zjOPHGSKLHpTDlp?usp=sharing)
|
||||||
|
|
||||||
|
|
||||||
|
#### [Transducer (Zipformer Encoder + Stateless Predictor)](https://github.com/k2-fsa/icefall/tree/master/egs/librispeech/ASR/zipformer)
|
||||||
|
|
||||||
|
WER (modified_beam_search `beam_size=4` unless further stated)
|
||||||
|
|
||||||
|
1. LibriSpeech-960hr
|
||||||
|
|
||||||
|
| Encoder | Params | test-clean | test-other | epochs | devices |
|
||||||
|
|-----------------|--------|------------|------------|---------|------------|
|
||||||
|
| Zipformer | 65.5M | 2.21 | 4.79 | 50 | 4 32G-V100 |
|
||||||
|
| Zipformer-small | 23.2M | 2.42 | 5.73 | 50 | 2 32G-V100 |
|
||||||
|
| Zipformer-large | 148.4M | 2.06 | 4.63 | 50 | 4 32G-V100 |
|
||||||
|
| Zipformer-large | 148.4M | 2.00 | 4.38 | 174 | 8 80G-A100 |
|
||||||
|
|
||||||
|
2. LibriSpeech-960hr + GigaSpeech
|
||||||
|
|
||||||
| Encoder | Params | test-clean | test-other |
|
| Encoder | Params | test-clean | test-other |
|
||||||
|-----------------|--------|------------|------------|
|
|-----------------|--------|------------|------------|
|
||||||
| zipformer | 65.5M | 2.21 | 4.91 |
|
| Zipformer | 65.5M | 1.78 | 4.08 |
|
||||||
| zipformer-small | 23.2M | 2.46 | 5.83 |
|
|
||||||
| zipformer-large | 148.4M | 2.11 | 4.77 |
|
|
||||||
|
|
||||||
Note: No auxiliary losses are used in the training and no LMs are used
|
|
||||||
in the decoding.
|
|
||||||
|
|
||||||
#### k2 pruned RNN-T + GigaSpeech
|
|
||||||
|
|
||||||
| | test-clean | test-other |
|
|
||||||
|-----|------------|------------|
|
|
||||||
| WER | 1.78 | 4.08 |
|
|
||||||
|
|
||||||
Note: No auxiliary losses are used in the training and no LMs are used
|
|
||||||
in the decoding.
|
|
||||||
|
|
||||||
#### k2 pruned RNN-T + GigaSpeech + CommonVoice
|
|
||||||
|
|
||||||
| | test-clean | test-other |
|
|
||||||
|-----|------------|------------|
|
|
||||||
| WER | 1.90 | 3.98 |
|
|
||||||
|
|
||||||
Note: No auxiliary losses are used in the training and no LMs are used
|
|
||||||
in the decoding.
|
|
||||||
|
|
||||||
|
|
||||||
### GigaSpeech
|
3. LibriSpeech-960hr + GigaSpeech + CommonVoice
|
||||||
|
|
||||||
We provide two models for this recipe: [Conformer CTC model][GigaSpeech_conformer_ctc]
|
| Encoder | Params | test-clean | test-other |
|
||||||
and [Pruned stateless RNN-T: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss][GigaSpeech_pruned_transducer_stateless2].
|
|-----------------|--------|------------|------------|
|
||||||
|
| Zipformer | 65.5M | 1.90 | 3.98 |
|
||||||
|
|
||||||
#### Conformer CTC
|
|
||||||
|
### [GigaSpeech][gigaspeech]
|
||||||
|
|
||||||
|
#### [Conformer CTC](https://github.com/k2-fsa/icefall/tree/master/egs/gigaspeech/ASR/conformer_ctc)
|
||||||
|
|
||||||
| | Dev | Test |
|
| | Dev | Test |
|
||||||
|-----|-------|-------|
|
|-----|-------|-------|
|
||||||
| WER | 10.47 | 10.58 |
|
| WER | 10.47 | 10.58 |
|
||||||
|
|
||||||
#### Pruned stateless RNN-T: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss
|
#### [Transducer (pruned_transducer_stateless2)](https://github.com/k2-fsa/icefall/tree/master/egs/gigaspeech/ASR/pruned_transducer_stateless2)
|
||||||
|
|
||||||
|
Conformer Encoder + Stateless Predictor + k2 Pruned RNN-T Loss
|
||||||
|
|
||||||
| | Dev | Test |
|
| | Dev | Test |
|
||||||
|----------------------|-------|-------|
|
|----------------------|-------|-------|
|
||||||
| greedy search | 10.51 | 10.73 |
|
| greedy_search | 10.51 | 10.73 |
|
||||||
| fast beam search | 10.50 | 10.69 |
|
| fast_beam_search | 10.50 | 10.69 |
|
||||||
| modified beam search | 10.40 | 10.51 |
|
| modified_beam_search | 10.40 | 10.51 |
|
||||||
|
|
||||||
|
#### [Transducer (Zipformer Encoder + Stateless Predictor)](https://github.com/k2-fsa/icefall/tree/master/egs/gigaspeech/ASR/zipformer)
|
||||||
|
|
||||||
|
| | Dev | Test |
|
||||||
|
|----------------------|-------|-------|
|
||||||
|
| greedy_search | 10.31 | 10.50 |
|
||||||
|
| fast_beam_search | 10.26 | 10.48 |
|
||||||
|
| modified_beam_search | 10.25 | 10.38 |
|
||||||
|
|
||||||
|
|
||||||
### Aishell
|
### [Aishell][aishell]
|
||||||
|
|
||||||
We provide three models for this recipe: [conformer CTC model][Aishell_conformer_ctc],
|
#### [TDNN LSTM CTC](https://github.com/k2-fsa/icefall/tree/master/egs/aishell/ASR/tdnn_lstm_ctc)
|
||||||
[TDNN LSTM CTC model][Aishell_tdnn_lstm_ctc], and [Transducer Stateless Model][Aishell_pruned_transducer_stateless7],
|
|
||||||
|
|
||||||
#### Conformer CTC Model
|
|
||||||
|
|
||||||
The best CER we currently have is:
|
|
||||||
|
|
||||||
| | test |
|
|
||||||
|-----|------|
|
|
||||||
| CER | 4.26 |
|
|
||||||
|
|
||||||
#### TDNN LSTM CTC Model
|
|
||||||
|
|
||||||
The CER for this model is:
|
|
||||||
|
|
||||||
| | test |
|
| | test |
|
||||||
|-----|-------|
|
|-----|-------|
|
||||||
| CER | 10.16 |
|
| CER | 10.16 |
|
||||||
|
|
||||||
We provide a Colab notebook to run a pre-trained TDNN LSTM CTC model: [](https://colab.research.google.com/drive/1jbyzYq3ytm6j2nlEt-diQm-6QVWyDDEa?usp=sharing)
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/1jbyzYq3ytm6j2nlEt-diQm-6QVWyDDEa?usp=sharing)
|
||||||
|
|
||||||
#### Transducer Stateless Model
|
#### [Transducer (Conformer Encoder + Stateless Predictor)](https://github.com/k2-fsa/icefall/tree/master/egs/aishell/ASR/transducer_stateless)
|
||||||
|
|
||||||
The best CER we currently have is:
|
|
||||||
|
|
||||||
| | test |
|
| | test |
|
||||||
|-----|------|
|
|-----|------|
|
||||||
| CER | 4.38 |
|
| CER | 4.38 |
|
||||||
|
|
||||||
We provide a Colab notebook to run a pre-trained TransducerStateless model: [](https://colab.research.google.com/drive/14XaT2MhnBkK-3_RqqWq3K90Xlbin-GZC?usp=sharing)
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/14XaT2MhnBkK-3_RqqWq3K90Xlbin-GZC?usp=sharing)
|
||||||
|
|
||||||
|
#### [Transducer (Zipformer Encoder + Stateless Predictor)](https://github.com/k2-fsa/icefall/tree/master/egs/aishell/ASR/zipformer)
|
||||||
|
|
||||||
|
WER (modified_beam_search `beam_size=4`)
|
||||||
|
|
||||||
|
| Encoder | Params | dev | test | epochs |
|
||||||
|
|-----------------|--------|-----|------|---------|
|
||||||
|
| Zipformer | 73.4M | 4.13| 4.40 | 55 |
|
||||||
|
| Zipformer-small | 30.2M | 4.40| 4.67 | 55 |
|
||||||
|
| Zipformer-large | 157.3M | 4.03| 4.28 | 56 |
|
||||||
|
|
||||||
|
|
||||||
### Aishell2
|
### [Aishell4][aishell4]
|
||||||
|
|
||||||
We provide one model for this recipe: [Transducer Stateless Model][Aishell2_pruned_transducer_stateless5].
|
#### [Transducer (pruned_transducer_stateless5)](https://github.com/k2-fsa/icefall/tree/master/egs/aishell4/ASR/pruned_transducer_stateless5)
|
||||||
|
|
||||||
#### Transducer Stateless Model
|
|
||||||
|
|
||||||
The best WER we currently have is:
|
|
||||||
|
|
||||||
| | dev-ios | test-ios |
|
|
||||||
|-----|------------|------------|
|
|
||||||
| WER | 5.32 | 5.56 |
|
|
||||||
|
|
||||||
|
|
||||||
### Aishell4
|
|
||||||
|
|
||||||
We provide one model for this recipe: [Pruned stateless RNN-T: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss][Aishell4_pruned_transducer_stateless5].
|
|
||||||
|
|
||||||
#### Pruned stateless RNN-T: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss (trained with all subsets)
|
|
||||||
|
|
||||||
The best CER we currently have is:
|
|
||||||
|
|
||||||
|
1 Trained with all subsets:
|
||||||
| | test |
|
| | test |
|
||||||
|-----|------------|
|
|-----|------------|
|
||||||
| CER | 29.08 |
|
| CER | 29.08 |
|
||||||
|
|
||||||
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/1z3lkURVv9M7uTiIgf3Np9IntMHEknaks?usp=sharing)
|
||||||
We provide a Colab notebook to run a pre-trained Pruned Transducer Stateless model: [](https://colab.research.google.com/drive/1z3lkURVv9M7uTiIgf3Np9IntMHEknaks?usp=sharing)
|
|
||||||
|
|
||||||
|
|
||||||
### TIMIT
|
### [TIMIT][timit]
|
||||||
|
|
||||||
We provide two models for this recipe: [TDNN LSTM CTC model][TIMIT_tdnn_lstm_ctc]
|
#### [TDNN LSTM CTC](https://github.com/k2-fsa/icefall/tree/master/egs/timit/ASR/tdnn_lstm_ctc)
|
||||||
and [TDNN LiGRU CTC model][TIMIT_tdnn_ligru_ctc].
|
|
||||||
|
|
||||||
#### TDNN LSTM CTC Model
|
| |TEST|
|
||||||
|
|---|----|
|
||||||
The best PER we currently have is:
|
|
||||||
|
|
||||||
||TEST|
|
|
||||||
|--|--|
|
|
||||||
|PER| 19.71% |
|
|PER| 19.71% |
|
||||||
|
|
||||||
We provide a Colab notebook to run a pre-trained TDNN LSTM CTC model: [](https://colab.research.google.com/drive/1Hs9DA4V96uapw_30uNp32OMJgkuR5VVd?usp=sharing)
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/1Hs9DA4V96uapw_30uNp32OMJgkuR5VVd?usp=sharing)
|
||||||
|
|
||||||
#### TDNN LiGRU CTC Model
|
#### [TDNN LiGRU CTC](https://github.com/k2-fsa/icefall/tree/master/egs/timit/ASR/tdnn_ligru_ctc)
|
||||||
|
|
||||||
The PER for this model is:
|
| |TEST|
|
||||||
|
|---|----|
|
||||||
||TEST|
|
|
||||||
|--|--|
|
|
||||||
|PER| 17.66% |
|
|PER| 17.66% |
|
||||||
|
|
||||||
We provide a Colab notebook to run a pre-trained TDNN LiGRU CTC model: [](https://colab.research.google.com/drive/1z3lkURVv9M7uTiIgf3Np9IntMHEknaks?usp=sharing)
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/1z3lkURVv9M7uTiIgf3Np9IntMHEknaks?usp=sharing)
|
||||||
|
|
||||||
|
|
||||||
### TED-LIUM3
|
### [TED-LIUM3][tedlium3]
|
||||||
|
|
||||||
We provide two models for this recipe: [Transducer Stateless: Conformer encoder + Embedding decoder][TED-LIUM3_transducer_stateless] and [Pruned Transducer Stateless: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss][TED-LIUM3_pruned_transducer_stateless].
|
#### [Transducer (Conformer Encoder + Stateless Predictor)](https://github.com/k2-fsa/icefall/tree/master/egs/tedlium3/ASR/transducer_stateless)
|
||||||
|
|
||||||
#### Transducer Stateless: Conformer encoder + Embedding decoder
|
| | dev | test |
|
||||||
|
|--------------------------------------|-------|--------|
|
||||||
The best WER using modified beam search with beam size 4 is:
|
| modified_beam_search (`beam_size=4`) | 6.91 | 6.33 |
|
||||||
|
|
||||||
| | dev | test |
|
|
||||||
|-----|-------|--------|
|
|
||||||
| WER | 6.91 | 6.33 |
|
|
||||||
|
|
||||||
Note: No auxiliary losses are used in the training and no LMs are used in the decoding.
|
|
||||||
|
|
||||||
We provide a Colab notebook to run a pre-trained Transducer Stateless model: [](https://colab.research.google.com/drive/1MmY5bBxwvKLNT4A2DJnwiqRXhdchUqPN?usp=sharing)
|
|
||||||
|
|
||||||
#### Pruned Transducer Stateless: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss
|
|
||||||
|
|
||||||
The best WER using modified beam search with beam size 4 is:
|
|
||||||
|
|
||||||
| | dev | test |
|
|
||||||
|-----|-------|--------|
|
|
||||||
| WER | 6.77 | 6.14 |
|
|
||||||
|
|
||||||
We provide a Colab notebook to run a pre-trained Pruned Transducer Stateless model: [](https://colab.research.google.com/drive/1je_1zGrOkGVVd4WLzgkXRHxl-I27yWtz?usp=sharing)
|
|
||||||
|
|
||||||
|
|
||||||
### Aidatatang_200zh
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/1MmY5bBxwvKLNT4A2DJnwiqRXhdchUqPN?usp=sharing)
|
||||||
|
|
||||||
We provide one model for this recipe: [Pruned stateless RNN-T: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss][Aidatatang_200zh_pruned_transducer_stateless2].
|
#### [Transducer (pruned_transducer_stateless)](https://github.com/k2-fsa/icefall/tree/master/egs/tedlium3/ASR/pruned_transducer_stateless)
|
||||||
|
|
||||||
#### Pruned stateless RNN-T: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss
|
| | dev | test |
|
||||||
|
|--------------------------------------|-------|--------|
|
||||||
|
| modified_beam_search (`beam_size=4`) | 6.77 | 6.14 |
|
||||||
|
|
||||||
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/1je_1zGrOkGVVd4WLzgkXRHxl-I27yWtz?usp=sharing)
|
||||||
|
|
||||||
|
|
||||||
|
### [Aidatatang_200zh][aidatatang_200zh]
|
||||||
|
|
||||||
|
#### [Transducer (pruned_transducer_stateless2)](https://github.com/k2-fsa/icefall/tree/master/egs/aidatatang_200zh/ASR/pruned_transducer_stateless2)
|
||||||
|
|
||||||
| | Dev | Test |
|
| | Dev | Test |
|
||||||
|----------------------|-------|-------|
|
|----------------------|-------|-------|
|
||||||
| greedy search | 5.53 | 6.59 |
|
| greedy_search | 5.53 | 6.59 |
|
||||||
| fast beam search | 5.30 | 6.34 |
|
| fast_beam_search | 5.30 | 6.34 |
|
||||||
| modified beam search | 5.27 | 6.33 |
|
| modified_beam_search | 5.27 | 6.33 |
|
||||||
|
|
||||||
We provide a Colab notebook to run a pre-trained Pruned Transducer Stateless model: [](https://colab.research.google.com/drive/1wNSnSj3T5oOctbh5IGCa393gKOoQw2GH?usp=sharing)
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/1wNSnSj3T5oOctbh5IGCa393gKOoQw2GH?usp=sharing)
|
||||||
|
|
||||||
|
|
||||||
### WenetSpeech
|
### [WenetSpeech][wenetspeech]
|
||||||
|
|
||||||
We provide some models for this recipe: [Pruned stateless RNN-T_2: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss][WenetSpeech_pruned_transducer_stateless2] and [Pruned stateless RNN-T_5: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss][WenetSpeech_pruned_transducer_stateless5].
|
#### [Transducer (pruned_transducer_stateless2)](https://github.com/k2-fsa/icefall/tree/master/egs/wenetspeech/ASR/pruned_transducer_stateless2)
|
||||||
|
|
||||||
#### Pruned stateless RNN-T_2: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss (trained with L subset, offline ASR)
|
|
||||||
|
|
||||||
| | Dev | Test-Net | Test-Meeting |
|
| | Dev | Test-Net | Test-Meeting |
|
||||||
|----------------------|-------|----------|--------------|
|
|----------------------|-------|----------|--------------|
|
||||||
| greedy search | 7.80 | 8.75 | 13.49 |
|
| greedy_search | 7.80 | 8.75 | 13.49 |
|
||||||
| modified beam search| 7.76 | 8.71 | 13.41 |
|
| fast_beam_search | 7.94 | 8.74 | 13.80 |
|
||||||
| fast beam search | 7.94 | 8.74 | 13.80 |
|
| modified_beam_search | 7.76 | 8.71 | 13.41 |
|
||||||
|
|
||||||
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/1EV4e1CHa1GZgEF-bZgizqI9RyFFehIiN?usp=sharing)
|
||||||
|
|
||||||
|
#### [Transducer **Streaming** (pruned_transducer_stateless5) ](https://github.com/k2-fsa/icefall/tree/master/egs/wenetspeech/ASR/pruned_transducer_stateless5)
|
||||||
|
|
||||||
#### Pruned stateless RNN-T_5: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss (trained with L subset)
|
|
||||||
**Streaming**:
|
|
||||||
| | Dev | Test-Net | Test-Meeting |
|
| | Dev | Test-Net | Test-Meeting |
|
||||||
|----------------------|-------|----------|--------------|
|
|----------------------|-------|----------|--------------|
|
||||||
| greedy_search | 8.78 | 10.12 | 16.16 |
|
| greedy_search | 8.78 | 10.12 | 16.16 |
|
||||||
| modified_beam_search | 8.53| 9.95 | 15.81 |
|
|
||||||
| fast_beam_search| 9.01 | 10.47 | 16.28 |
|
| fast_beam_search| 9.01 | 10.47 | 16.28 |
|
||||||
|
| modified_beam_search | 8.53| 9.95 | 15.81 |
|
||||||
|
|
||||||
We provide a Colab notebook to run a pre-trained Pruned Transducer Stateless2 model: [](https://colab.research.google.com/drive/1EV4e1CHa1GZgEF-bZgizqI9RyFFehIiN?usp=sharing)
|
|
||||||
|
|
||||||
### Alimeeting
|
### [Alimeeting][alimeeting]
|
||||||
|
|
||||||
We provide one model for this recipe: [Pruned stateless RNN-T: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss][Alimeeting_pruned_transducer_stateless2].
|
#### [Transducer (pruned_transducer_stateless2)](https://github.com/k2-fsa/icefall/tree/master/egs/alimeeting/ASR/pruned_transducer_stateless2)
|
||||||
|
|
||||||
#### Pruned stateless RNN-T: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss (trained with far subset)
|
|
||||||
|
|
||||||
| | Eval | Test-Net |
|
| | Eval | Test-Net |
|
||||||
|----------------------|--------|----------|
|
|----------------------|--------|----------|
|
||||||
| greedy search | 31.77 | 34.66 |
|
| greedy_search | 31.77 | 34.66 |
|
||||||
| fast beam search | 31.39 | 33.02 |
|
| fast_beam_search | 31.39 | 33.02 |
|
||||||
| modified beam search | 30.38 | 34.25 |
|
| modified_beam_search | 30.38 | 34.25 |
|
||||||
|
|
||||||
We provide a Colab notebook to run a pre-trained Pruned Transducer Stateless model: [](https://colab.research.google.com/drive/1tKr3f0mL17uO_ljdHGKtR7HOmthYHwJG?usp=sharing)
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/1tKr3f0mL17uO_ljdHGKtR7HOmthYHwJG?usp=sharing)
|
||||||
|
|
||||||
|
|
||||||
### TAL_CSASR
|
### [TAL_CSASR][tal_csasr]
|
||||||
|
|
||||||
We provide one model for this recipe: [Pruned stateless RNN-T: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss][TAL_CSASR_pruned_transducer_stateless5].
|
|
||||||
|
|
||||||
#### Pruned stateless RNN-T: Conformer encoder + Embedding decoder + k2 pruned RNN-T loss
|
#### [Transducer (pruned_transducer_stateless5)](https://github.com/k2-fsa/icefall/tree/master/egs/tal_csasr/ASR/pruned_transducer_stateless5)
|
||||||
|
|
||||||
The best results for Chinese CER(%) and English WER(%) respectively (zh: Chinese, en: English):
|
The best results for Chinese CER(%) and English WER(%) respectively (zh: Chinese, en: English):
|
||||||
|decoding-method | dev | dev_zh | dev_en | test | test_zh | test_en |
|
|decoding-method | dev | dev_zh | dev_en | test | test_zh | test_en |
|
||||||
|--|--|--|--|--|--|--|
|
|--|--|--|--|--|--|--|
|
||||||
|greedy_search| 7.30 | 6.48 | 19.19 |7.39| 6.66 | 19.13|
|
|greedy_search| 7.30 | 6.48 | 19.19 |7.39| 6.66 | 19.13|
|
||||||
|modified_beam_search| 7.15 | 6.35 | 18.95 | 7.22| 6.50 | 18.70 |
|
|
||||||
|fast_beam_search| 7.18 | 6.39| 18.90 | 7.27| 6.55 | 18.77|
|
|fast_beam_search| 7.18 | 6.39| 18.90 | 7.27| 6.55 | 18.77|
|
||||||
|
|modified_beam_search| 7.15 | 6.35 | 18.95 | 7.22| 6.50 | 18.70 |
|
||||||
|
|
||||||
We provide a Colab notebook to run a pre-trained Pruned Transducer Stateless model: [](https://colab.research.google.com/drive/1DmIx-NloI1CMU5GdZrlse7TRu4y3Dpf8?usp=sharing)
|
We provide a Colab notebook to test the pre-trained model: [](https://colab.research.google.com/drive/1DmIx-NloI1CMU5GdZrlse7TRu4y3Dpf8?usp=sharing)
|
||||||
|
|
||||||
## Deployment with C++
|
## TTS: Text-to-Speech
|
||||||
|
|
||||||
Once you have trained a model in icefall, you may want to deploy it with C++,
|
### Supported Datasets
|
||||||
without Python dependencies.
|
|
||||||
|
- [LJSpeech][ljspeech]
|
||||||
|
- [VCTK][vctk]
|
||||||
|
|
||||||
|
### Supported Models
|
||||||
|
|
||||||
|
- [VITS](https://arxiv.org/abs/2106.06103)
|
||||||
|
|
||||||
|
# Deployment with C++
|
||||||
|
|
||||||
|
Once you have trained a model in icefall, you may want to deploy it with C++ without Python dependencies.
|
||||||
|
|
||||||
|
Please refer to
|
||||||
|
|
||||||
|
- https://k2-fsa.github.io/icefall/model-export/export-with-torch-jit-script.html
|
||||||
|
- https://k2-fsa.github.io/icefall/model-export/export-onnx.html
|
||||||
|
- https://k2-fsa.github.io/icefall/model-export/export-ncnn.html
|
||||||
|
|
||||||
Please refer to the documentation
|
|
||||||
<https://icefall.readthedocs.io/en/latest/recipes/librispeech/conformer_ctc.html#deployment-with-c>
|
|
||||||
for how to do this.
|
for how to do this.
|
||||||
|
|
||||||
We also provide a Colab notebook, showing you how to run a torch scripted model in [k2][k2] with C++.
|
We also provide a Colab notebook, showing you how to run a torch scripted model in [k2][k2] with C++.
|
||||||
Please see: [](https://colab.research.google.com/drive/1BIGLWzS36isskMXHKcqC9ysN6pspYXs_?usp=sharing)
|
Please see: [](https://colab.research.google.com/drive/1BIGLWzS36isskMXHKcqC9ysN6pspYXs_?usp=sharing)
|
||||||
|
|
||||||
|
|
||||||
[LibriSpeech_tdnn_lstm_ctc]: egs/librispeech/ASR/tdnn_lstm_ctc
|
|
||||||
[LibriSpeech_conformer_ctc]: egs/librispeech/ASR/conformer_ctc
|
|
||||||
[LibriSpeech_transducer]: egs/librispeech/ASR/transducer
|
|
||||||
[LibriSpeech_transducer_stateless]: egs/librispeech/ASR/transducer_stateless
|
|
||||||
[LibriSpeech_zipformer]: egs/librispeech/ASR/zipformer
|
|
||||||
[Aishell_tdnn_lstm_ctc]: egs/aishell/ASR/tdnn_lstm_ctc
|
|
||||||
[Aishell_conformer_ctc]: egs/aishell/ASR/conformer_ctc
|
|
||||||
[Aishell_pruned_transducer_stateless7]: egs/aishell/ASR/pruned_transducer_stateless7_bbpe
|
|
||||||
[Aishell2_pruned_transducer_stateless5]: egs/aishell2/ASR/pruned_transducer_stateless5
|
|
||||||
[Aishell4_pruned_transducer_stateless5]: egs/aishell4/ASR/pruned_transducer_stateless5
|
|
||||||
[TIMIT_tdnn_lstm_ctc]: egs/timit/ASR/tdnn_lstm_ctc
|
|
||||||
[TIMIT_tdnn_ligru_ctc]: egs/timit/ASR/tdnn_ligru_ctc
|
|
||||||
[TED-LIUM3_transducer_stateless]: egs/tedlium3/ASR/transducer_stateless
|
|
||||||
[TED-LIUM3_pruned_transducer_stateless]: egs/tedlium3/ASR/pruned_transducer_stateless
|
|
||||||
[GigaSpeech_conformer_ctc]: egs/gigaspeech/ASR/conformer_ctc
|
|
||||||
[GigaSpeech_pruned_transducer_stateless2]: egs/gigaspeech/ASR/pruned_transducer_stateless2
|
|
||||||
[Aidatatang_200zh_pruned_transducer_stateless2]: egs/aidatatang_200zh/ASR/pruned_transducer_stateless2
|
|
||||||
[WenetSpeech_pruned_transducer_stateless2]: egs/wenetspeech/ASR/pruned_transducer_stateless2
|
|
||||||
[WenetSpeech_pruned_transducer_stateless5]: egs/wenetspeech/ASR/pruned_transducer_stateless5
|
|
||||||
[Alimeeting_pruned_transducer_stateless2]: egs/alimeeting/ASR/pruned_transducer_stateless2
|
|
||||||
[TAL_CSASR_pruned_transducer_stateless5]: egs/tal_csasr/ASR/pruned_transducer_stateless5
|
|
||||||
[yesno]: egs/yesno/ASR
|
[yesno]: egs/yesno/ASR
|
||||||
[librispeech]: egs/librispeech/ASR
|
[librispeech]: egs/librispeech/ASR
|
||||||
[aishell]: egs/aishell/ASR
|
[aishell]: egs/aishell/ASR
|
||||||
@ -393,4 +367,18 @@ Please see: [
|
|
||||||
- end in a newline and only a newline
|
|
||||||
- contain sorted `imports` (checked by [isort][isort])
|
|
||||||
|
|
||||||
These hooks are disabled by default. Please use the following commands to enable them:
|
- Ensuring there are no trailing spaces.
|
||||||
|
- Formatting code with [black](https://github.com/psf/black).
|
||||||
|
- Checking compliance with PEP8 using [flake8](https://flake8.pycqa.org/).
|
||||||
|
- Verifying that files end with a newline character (and only a newline).
|
||||||
|
- Sorting imports using [isort](https://pycqa.github.io/isort/).
|
||||||
|
|
||||||
```bash
|
Please note that these hooks are disabled by default. To enable them, follow these steps:
|
||||||
pip install pre-commit # run it only once
|
|
||||||
pre-commit install # run it only once, it will install all hooks
|
|
||||||
|
|
||||||
# modify some files
|
### Installation (Run only once)
|
||||||
git add <some files>
|
|
||||||
git commit # It runs all hooks automatically.
|
|
||||||
|
|
||||||
# If all hooks run successfully, you can write the commit message now. Done!
|
1. Install the `pre-commit` package using pip:
|
||||||
#
|
```bash
|
||||||
# If any hook failed, your commit was not successful.
|
pip install pre-commit
|
||||||
# Please read the error messages and make changes accordingly.
|
```
|
||||||
# And rerun
|
1. Install the Git hooks using:
|
||||||
|
```bash
|
||||||
|
pre-commit install
|
||||||
|
```
|
||||||
|
### Making a Commit
|
||||||
|
Once you have enabled the pre-commit hooks, follow these steps when making a commit:
|
||||||
|
1. Make your changes to the codebase.
|
||||||
|
2. Stage your changes by using git add for the files you modified.
|
||||||
|
3. Commit your changes using git commit. The pre-commit hooks will run automatically at this point.
|
||||||
|
4. If all hooks run successfully, you can write your commit message, and your changes will be successfully committed.
|
||||||
|
5. If any hook fails, your commit will not be successful. Please read and follow the error messages provided, make the necessary changes, and then re-run git add and git commit.
|
||||||
|
|
||||||
git add <some files>
|
### Your Contribution
|
||||||
git commit
|
Your contributions are valuable to us, and by following these guidelines, you help maintain code consistency and quality in our project. We appreciate your dedication to ensuring high-quality code. If you have questions or need assistance, feel free to reach out to us. Thank you for being part of our open-source community!
|
||||||
```
|
|
||||||
|
|
||||||
[git]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
|
|
||||||
[flake8]: https://github.com/PyCQA/flake8
|
|
||||||
[PEP8]: https://www.python.org/dev/peps/pep-0008/
|
|
||||||
[black]: https://github.com/psf/black
|
|
||||||
[hooks]: https://github.com/pre-commit/pre-commit-hooks
|
|
||||||
[pre-commit]: https://github.com/pre-commit/pre-commit
|
|
||||||
[isort]: https://github.com/PyCQA/isort
|
|
||||||
|
|||||||
@ -4,8 +4,9 @@ ENV LC_ALL C.UTF-8
|
|||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
ARG K2_VERSION="1.24.3.dev20230725+cuda11.3.torch1.12.1"
|
# python 3.7
|
||||||
ARG KALDIFEAT_VERSION="1.25.0.dev20230726+cuda11.3.torch1.12.1"
|
ARG K2_VERSION="1.24.4.dev20240223+cuda11.3.torch1.12.1"
|
||||||
|
ARG KALDIFEAT_VERSION="1.25.4.dev20240223+cuda11.3.torch1.12.1"
|
||||||
ARG TORCHAUDIO_VERSION="0.12.1+cu113"
|
ARG TORCHAUDIO_VERSION="0.12.1+cu113"
|
||||||
|
|
||||||
LABEL authors="Fangjun Kuang <csukuangfj@gmail.com>"
|
LABEL authors="Fangjun Kuang <csukuangfj@gmail.com>"
|
||||||
@ -17,7 +18,7 @@ RUN apt-get update && \
|
|||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
curl \
|
curl \
|
||||||
vim \
|
vim \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
autoconf \
|
autoconf \
|
||||||
automake \
|
automake \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
@ -43,7 +44,6 @@ RUN pip install --no-cache-dir \
|
|||||||
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \
|
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \
|
||||||
git+https://github.com/lhotse-speech/lhotse \
|
git+https://github.com/lhotse-speech/lhotse \
|
||||||
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \
|
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \
|
||||||
\
|
|
||||||
kaldi_native_io \
|
kaldi_native_io \
|
||||||
kaldialign \
|
kaldialign \
|
||||||
kaldifst \
|
kaldifst \
|
||||||
@ -55,6 +55,8 @@ RUN pip install --no-cache-dir \
|
|||||||
onnx \
|
onnx \
|
||||||
onnxruntime \
|
onnxruntime \
|
||||||
onnxmltools \
|
onnxmltools \
|
||||||
|
onnxoptimizer \
|
||||||
|
onnxsim \
|
||||||
multi_quantization \
|
multi_quantization \
|
||||||
typeguard \
|
typeguard \
|
||||||
numpy \
|
numpy \
|
||||||
|
|||||||
@ -4,8 +4,9 @@ ENV LC_ALL C.UTF-8
|
|||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
ARG K2_VERSION="1.24.3.dev20230725+cuda11.6.torch1.13.0"
|
# python 3.9
|
||||||
ARG KALDIFEAT_VERSION="1.25.0.dev20230726+cuda11.6.torch1.13.0"
|
ARG K2_VERSION="1.24.4.dev20240223+cuda11.6.torch1.13.0"
|
||||||
|
ARG KALDIFEAT_VERSION="1.25.4.dev20240223+cuda11.6.torch1.13.0"
|
||||||
ARG TORCHAUDIO_VERSION="0.13.0+cu116"
|
ARG TORCHAUDIO_VERSION="0.13.0+cu116"
|
||||||
|
|
||||||
LABEL authors="Fangjun Kuang <csukuangfj@gmail.com>"
|
LABEL authors="Fangjun Kuang <csukuangfj@gmail.com>"
|
||||||
@ -17,7 +18,7 @@ RUN apt-get update && \
|
|||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
curl \
|
curl \
|
||||||
vim \
|
vim \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
autoconf \
|
autoconf \
|
||||||
automake \
|
automake \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
@ -43,7 +44,6 @@ RUN pip install --no-cache-dir \
|
|||||||
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \
|
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \
|
||||||
git+https://github.com/lhotse-speech/lhotse \
|
git+https://github.com/lhotse-speech/lhotse \
|
||||||
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \
|
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \
|
||||||
\
|
|
||||||
kaldi_native_io \
|
kaldi_native_io \
|
||||||
kaldialign \
|
kaldialign \
|
||||||
kaldifst \
|
kaldifst \
|
||||||
@ -55,6 +55,8 @@ RUN pip install --no-cache-dir \
|
|||||||
onnx \
|
onnx \
|
||||||
onnxruntime \
|
onnxruntime \
|
||||||
onnxmltools \
|
onnxmltools \
|
||||||
|
onnxoptimizer \
|
||||||
|
onnxsim \
|
||||||
multi_quantization \
|
multi_quantization \
|
||||||
typeguard \
|
typeguard \
|
||||||
numpy \
|
numpy \
|
||||||
|
|||||||
@ -4,8 +4,9 @@ ENV LC_ALL C.UTF-8
|
|||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
ARG K2_VERSION="1.24.3.dev20230726+cuda10.2.torch1.9.0"
|
# python 3.7
|
||||||
ARG KALDIFEAT_VERSION="1.25.0.dev20230726+cuda10.2.torch1.9.0"
|
ARG K2_VERSION="1.24.4.dev20240223+cuda10.2.torch1.9.0"
|
||||||
|
ARG KALDIFEAT_VERSION="1.25.4.dev20240223+cuda10.2.torch1.9.0"
|
||||||
ARG TORCHAUDIO_VERSION="0.9.0"
|
ARG TORCHAUDIO_VERSION="0.9.0"
|
||||||
|
|
||||||
LABEL authors="Fangjun Kuang <csukuangfj@gmail.com>"
|
LABEL authors="Fangjun Kuang <csukuangfj@gmail.com>"
|
||||||
@ -24,7 +25,7 @@ RUN apt-get update && \
|
|||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
curl \
|
curl \
|
||||||
vim \
|
vim \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
autoconf \
|
autoconf \
|
||||||
automake \
|
automake \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
@ -57,7 +58,6 @@ RUN pip uninstall -y tqdm && \
|
|||||||
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \
|
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \
|
||||||
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \
|
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \
|
||||||
git+https://github.com/lhotse-speech/lhotse \
|
git+https://github.com/lhotse-speech/lhotse \
|
||||||
\
|
|
||||||
kaldi_native_io \
|
kaldi_native_io \
|
||||||
kaldialign \
|
kaldialign \
|
||||||
kaldifst \
|
kaldifst \
|
||||||
@ -69,6 +69,8 @@ RUN pip uninstall -y tqdm && \
|
|||||||
onnx \
|
onnx \
|
||||||
onnxruntime \
|
onnxruntime \
|
||||||
onnxmltools \
|
onnxmltools \
|
||||||
|
onnxoptimizer \
|
||||||
|
onnxsim \
|
||||||
multi_quantization \
|
multi_quantization \
|
||||||
typeguard \
|
typeguard \
|
||||||
numpy \
|
numpy \
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel
|
FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel
|
||||||
|
# python 3.10
|
||||||
|
|
||||||
ENV LC_ALL C.UTF-8
|
ENV LC_ALL C.UTF-8
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
ARG K2_VERSION="1.24.3.dev20230718+cuda11.7.torch2.0.0"
|
# python 3.10
|
||||||
ARG KALDIFEAT_VERSION="1.25.0.dev20230726+cuda11.7.torch2.0.0"
|
ARG K2_VERSION="1.24.4.dev20240223+cuda11.7.torch2.0.0"
|
||||||
|
ARG KALDIFEAT_VERSION="1.25.4.dev20240223+cuda11.7.torch2.0.0"
|
||||||
ARG TORCHAUDIO_VERSION="2.0.0+cu117"
|
ARG TORCHAUDIO_VERSION="2.0.0+cu117"
|
||||||
|
|
||||||
LABEL authors="Fangjun Kuang <csukuangfj@gmail.com>"
|
LABEL authors="Fangjun Kuang <csukuangfj@gmail.com>"
|
||||||
@ -17,7 +19,7 @@ RUN apt-get update && \
|
|||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
curl \
|
curl \
|
||||||
vim \
|
vim \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
autoconf \
|
autoconf \
|
||||||
automake \
|
automake \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
@ -39,11 +41,10 @@ RUN apt-get update && \
|
|||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN pip install --no-cache-dir \
|
RUN pip install --no-cache-dir \
|
||||||
torchaudio==${TORCHAUDIO_VERSION} -f https://download.pytorch.org/whl/torch_stable.html \
|
torchaudio==${TORCHAUDIO_VERSION} -f https://download.pytorch.org/whl/torchaudio/ \
|
||||||
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \
|
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \
|
||||||
git+https://github.com/lhotse-speech/lhotse \
|
git+https://github.com/lhotse-speech/lhotse \
|
||||||
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \
|
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \
|
||||||
\
|
|
||||||
kaldi_native_io \
|
kaldi_native_io \
|
||||||
kaldialign \
|
kaldialign \
|
||||||
kaldifst \
|
kaldifst \
|
||||||
@ -55,6 +56,8 @@ RUN pip install --no-cache-dir \
|
|||||||
onnx \
|
onnx \
|
||||||
onnxruntime \
|
onnxruntime \
|
||||||
onnxmltools \
|
onnxmltools \
|
||||||
|
onnxoptimizer \
|
||||||
|
onnxsim \
|
||||||
multi_quantization \
|
multi_quantization \
|
||||||
typeguard \
|
typeguard \
|
||||||
numpy \
|
numpy \
|
||||||
|
|||||||
73
docker/torch2.1.0-cuda11.8.dockerfile
Normal file
73
docker/torch2.1.0-cuda11.8.dockerfile
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-devel
|
||||||
|
# python 3.10
|
||||||
|
|
||||||
|
ENV LC_ALL C.UTF-8
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# python 3.10
|
||||||
|
ARG K2_VERSION="1.24.4.dev20240223+cuda11.8.torch2.1.0"
|
||||||
|
ARG KALDIFEAT_VERSION="1.25.4.dev20240223+cuda11.8.torch2.1.0"
|
||||||
|
ARG TORCHAUDIO_VERSION="2.1.0+cu118"
|
||||||
|
|
||||||
|
LABEL authors="Fangjun Kuang <csukuangfj@gmail.com>"
|
||||||
|
LABEL k2_version=${K2_VERSION}
|
||||||
|
LABEL kaldifeat_version=${KALDIFEAT_VERSION}
|
||||||
|
LABEL github_repo="https://github.com/k2-fsa/icefall"
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
curl \
|
||||||
|
vim \
|
||||||
|
libssl-dev \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
bzip2 \
|
||||||
|
ca-certificates \
|
||||||
|
ffmpeg \
|
||||||
|
g++ \
|
||||||
|
gfortran \
|
||||||
|
git \
|
||||||
|
libtool \
|
||||||
|
make \
|
||||||
|
patch \
|
||||||
|
sox \
|
||||||
|
subversion \
|
||||||
|
unzip \
|
||||||
|
valgrind \
|
||||||
|
wget \
|
||||||
|
zlib1g-dev \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN pip install --no-cache-dir \
|
||||||
|
torchaudio==${TORCHAUDIO_VERSION} -f https://download.pytorch.org/whl/torchaudio/ \
|
||||||
|
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \
|
||||||
|
git+https://github.com/lhotse-speech/lhotse \
|
||||||
|
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \
|
||||||
|
kaldi_native_io \
|
||||||
|
kaldialign \
|
||||||
|
kaldifst \
|
||||||
|
kaldilm \
|
||||||
|
sentencepiece>=0.1.96 \
|
||||||
|
tensorboard \
|
||||||
|
typeguard \
|
||||||
|
dill \
|
||||||
|
onnx \
|
||||||
|
onnxruntime \
|
||||||
|
onnxmltools \
|
||||||
|
onnxoptimizer \
|
||||||
|
onnxsim \
|
||||||
|
multi_quantization \
|
||||||
|
typeguard \
|
||||||
|
numpy \
|
||||||
|
pytest \
|
||||||
|
graphviz
|
||||||
|
|
||||||
|
RUN git clone https://github.com/k2-fsa/icefall /workspace/icefall && \
|
||||||
|
cd /workspace/icefall && \
|
||||||
|
pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
ENV PYTHONPATH /workspace/icefall:$PYTHONPATH
|
||||||
|
|
||||||
|
WORKDIR /workspace/icefall
|
||||||
73
docker/torch2.1.0-cuda12.1.dockerfile
Normal file
73
docker/torch2.1.0-cuda12.1.dockerfile
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-devel
|
||||||
|
# python 3.10
|
||||||
|
|
||||||
|
ENV LC_ALL C.UTF-8
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# python 3.10
|
||||||
|
ARG K2_VERSION="1.24.4.dev20240223+cuda12.1.torch2.1.0"
|
||||||
|
ARG KALDIFEAT_VERSION="1.25.4.dev20240223+cuda12.1.torch2.1.0"
|
||||||
|
ARG TORCHAUDIO_VERSION="2.1.0+cu121"
|
||||||
|
|
||||||
|
LABEL authors="Fangjun Kuang <csukuangfj@gmail.com>"
|
||||||
|
LABEL k2_version=${K2_VERSION}
|
||||||
|
LABEL kaldifeat_version=${KALDIFEAT_VERSION}
|
||||||
|
LABEL github_repo="https://github.com/k2-fsa/icefall"
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
curl \
|
||||||
|
vim \
|
||||||
|
libssl-dev \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
bzip2 \
|
||||||
|
ca-certificates \
|
||||||
|
ffmpeg \
|
||||||
|
g++ \
|
||||||
|
gfortran \
|
||||||
|
git \
|
||||||
|
libtool \
|
||||||
|
make \
|
||||||
|
patch \
|
||||||
|
sox \
|
||||||
|
subversion \
|
||||||
|
unzip \
|
||||||
|
valgrind \
|
||||||
|
wget \
|
||||||
|
zlib1g-dev \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN pip install --no-cache-dir \
|
||||||
|
torchaudio==${TORCHAUDIO_VERSION} -f https://download.pytorch.org/whl/torchaudio/ \
|
||||||
|
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \
|
||||||
|
git+https://github.com/lhotse-speech/lhotse \
|
||||||
|
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \
|
||||||
|
kaldi_native_io \
|
||||||
|
kaldialign \
|
||||||
|
kaldifst \
|
||||||
|
kaldilm \
|
||||||
|
sentencepiece>=0.1.96 \
|
||||||
|
tensorboard \
|
||||||
|
typeguard \
|
||||||
|
dill \
|
||||||
|
onnx \
|
||||||
|
onnxruntime \
|
||||||
|
onnxmltools \
|
||||||
|
onnxoptimizer \
|
||||||
|
onnxsim \
|
||||||
|
multi_quantization \
|
||||||
|
typeguard \
|
||||||
|
numpy \
|
||||||
|
pytest \
|
||||||
|
graphviz
|
||||||
|
|
||||||
|
RUN git clone https://github.com/k2-fsa/icefall /workspace/icefall && \
|
||||||
|
cd /workspace/icefall && \
|
||||||
|
pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
ENV PYTHONPATH /workspace/icefall:$PYTHONPATH
|
||||||
|
|
||||||
|
WORKDIR /workspace/icefall
|
||||||
73
docker/torch2.2.0-cuda11.8.dockerfile
Normal file
73
docker/torch2.2.0-cuda11.8.dockerfile
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
FROM pytorch/pytorch:2.2.0-cuda11.8-cudnn8-devel
|
||||||
|
# python 3.10
|
||||||
|
|
||||||
|
ENV LC_ALL C.UTF-8
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# python 3.10
|
||||||
|
ARG K2_VERSION="1.24.4.dev20240223+cuda11.8.torch2.2.0"
|
||||||
|
ARG KALDIFEAT_VERSION="1.25.4.dev20240223+cuda11.8.torch2.2.0"
|
||||||
|
ARG TORCHAUDIO_VERSION="2.2.0+cu118"
|
||||||
|
|
||||||
|
LABEL authors="Fangjun Kuang <csukuangfj@gmail.com>"
|
||||||
|
LABEL k2_version=${K2_VERSION}
|
||||||
|
LABEL kaldifeat_version=${KALDIFEAT_VERSION}
|
||||||
|
LABEL github_repo="https://github.com/k2-fsa/icefall"
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
curl \
|
||||||
|
vim \
|
||||||
|
libssl-dev \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
bzip2 \
|
||||||
|
ca-certificates \
|
||||||
|
ffmpeg \
|
||||||
|
g++ \
|
||||||
|
gfortran \
|
||||||
|
git \
|
||||||
|
libtool \
|
||||||
|
make \
|
||||||
|
patch \
|
||||||
|
sox \
|
||||||
|
subversion \
|
||||||
|
unzip \
|
||||||
|
valgrind \
|
||||||
|
wget \
|
||||||
|
zlib1g-dev \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN pip install --no-cache-dir \
|
||||||
|
torchaudio==${TORCHAUDIO_VERSION} -f https://download.pytorch.org/whl/torchaudio/ \
|
||||||
|
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \
|
||||||
|
git+https://github.com/lhotse-speech/lhotse \
|
||||||
|
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \
|
||||||
|
kaldi_native_io \
|
||||||
|
kaldialign \
|
||||||
|
kaldifst \
|
||||||
|
kaldilm \
|
||||||
|
sentencepiece>=0.1.96 \
|
||||||
|
tensorboard \
|
||||||
|
typeguard \
|
||||||
|
dill \
|
||||||
|
onnx \
|
||||||
|
onnxruntime \
|
||||||
|
onnxmltools \
|
||||||
|
onnxoptimizer \
|
||||||
|
onnxsim \
|
||||||
|
multi_quantization \
|
||||||
|
typeguard \
|
||||||
|
numpy \
|
||||||
|
pytest \
|
||||||
|
graphviz
|
||||||
|
|
||||||
|
RUN git clone https://github.com/k2-fsa/icefall /workspace/icefall && \
|
||||||
|
cd /workspace/icefall && \
|
||||||
|
pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
ENV PYTHONPATH /workspace/icefall:$PYTHONPATH
|
||||||
|
|
||||||
|
WORKDIR /workspace/icefall
|
||||||
73
docker/torch2.2.0-cuda12.1.dockerfile
Normal file
73
docker/torch2.2.0-cuda12.1.dockerfile
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
FROM pytorch/pytorch:2.2.0-cuda12.1-cudnn8-devel
|
||||||
|
# python 3.10
|
||||||
|
|
||||||
|
ENV LC_ALL C.UTF-8
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# python 3.10
|
||||||
|
ARG K2_VERSION="1.24.4.dev20240223+cuda12.1.torch2.2.0"
|
||||||
|
ARG KALDIFEAT_VERSION="1.25.4.dev20240223+cuda12.1.torch2.2.0"
|
||||||
|
ARG TORCHAUDIO_VERSION="2.2.0+cu121"
|
||||||
|
|
||||||
|
LABEL authors="Fangjun Kuang <csukuangfj@gmail.com>"
|
||||||
|
LABEL k2_version=${K2_VERSION}
|
||||||
|
LABEL kaldifeat_version=${KALDIFEAT_VERSION}
|
||||||
|
LABEL github_repo="https://github.com/k2-fsa/icefall"
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
curl \
|
||||||
|
vim \
|
||||||
|
libssl-dev \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
bzip2 \
|
||||||
|
ca-certificates \
|
||||||
|
ffmpeg \
|
||||||
|
g++ \
|
||||||
|
gfortran \
|
||||||
|
git \
|
||||||
|
libtool \
|
||||||
|
make \
|
||||||
|
patch \
|
||||||
|
sox \
|
||||||
|
subversion \
|
||||||
|
unzip \
|
||||||
|
valgrind \
|
||||||
|
wget \
|
||||||
|
zlib1g-dev \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN pip install --no-cache-dir \
|
||||||
|
torchaudio==${TORCHAUDIO_VERSION} -f https://download.pytorch.org/whl/torchaudio/ \
|
||||||
|
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \
|
||||||
|
git+https://github.com/lhotse-speech/lhotse \
|
||||||
|
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \
|
||||||
|
kaldi_native_io \
|
||||||
|
kaldialign \
|
||||||
|
kaldifst \
|
||||||
|
kaldilm \
|
||||||
|
sentencepiece>=0.1.96 \
|
||||||
|
tensorboard \
|
||||||
|
typeguard \
|
||||||
|
dill \
|
||||||
|
onnx \
|
||||||
|
onnxruntime \
|
||||||
|
onnxmltools \
|
||||||
|
onnxoptimizer \
|
||||||
|
onnxsim \
|
||||||
|
multi_quantization \
|
||||||
|
typeguard \
|
||||||
|
numpy \
|
||||||
|
pytest \
|
||||||
|
graphviz
|
||||||
|
|
||||||
|
RUN git clone https://github.com/k2-fsa/icefall /workspace/icefall && \
|
||||||
|
cd /workspace/icefall && \
|
||||||
|
pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
ENV PYTHONPATH /workspace/icefall:$PYTHONPATH
|
||||||
|
|
||||||
|
WORKDIR /workspace/icefall
|
||||||
73
docker/torch2.2.1-cuda11.8.dockerfile
Normal file
73
docker/torch2.2.1-cuda11.8.dockerfile
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
FROM pytorch/pytorch:2.2.1-cuda11.8-cudnn8-devel
|
||||||
|
# python 3.10
|
||||||
|
|
||||||
|
ENV LC_ALL C.UTF-8
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# python 3.10
|
||||||
|
ARG K2_VERSION="1.24.4.dev20240223+cuda11.8.torch2.2.1"
|
||||||
|
ARG KALDIFEAT_VERSION="1.25.4.dev20240223+cuda11.8.torch2.2.1"
|
||||||
|
ARG TORCHAUDIO_VERSION="2.2.1+cu118"
|
||||||
|
|
||||||
|
LABEL authors="Fangjun Kuang <csukuangfj@gmail.com>"
|
||||||
|
LABEL k2_version=${K2_VERSION}
|
||||||
|
LABEL kaldifeat_version=${KALDIFEAT_VERSION}
|
||||||
|
LABEL github_repo="https://github.com/k2-fsa/icefall"
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
curl \
|
||||||
|
vim \
|
||||||
|
libssl-dev \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
bzip2 \
|
||||||
|
ca-certificates \
|
||||||
|
ffmpeg \
|
||||||
|
g++ \
|
||||||
|
gfortran \
|
||||||
|
git \
|
||||||
|
libtool \
|
||||||
|
make \
|
||||||
|
patch \
|
||||||
|
sox \
|
||||||
|
subversion \
|
||||||
|
unzip \
|
||||||
|
valgrind \
|
||||||
|
wget \
|
||||||
|
zlib1g-dev \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN pip install --no-cache-dir \
|
||||||
|
torchaudio==${TORCHAUDIO_VERSION} -f https://download.pytorch.org/whl/torchaudio/ \
|
||||||
|
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \
|
||||||
|
git+https://github.com/lhotse-speech/lhotse \
|
||||||
|
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \
|
||||||
|
kaldi_native_io \
|
||||||
|
kaldialign \
|
||||||
|
kaldifst \
|
||||||
|
kaldilm \
|
||||||
|
sentencepiece>=0.1.96 \
|
||||||
|
tensorboard \
|
||||||
|
typeguard \
|
||||||
|
dill \
|
||||||
|
onnx \
|
||||||
|
onnxruntime \
|
||||||
|
onnxmltools \
|
||||||
|
onnxoptimizer \
|
||||||
|
onnxsim \
|
||||||
|
multi_quantization \
|
||||||
|
typeguard \
|
||||||
|
numpy \
|
||||||
|
pytest \
|
||||||
|
graphviz
|
||||||
|
|
||||||
|
RUN git clone https://github.com/k2-fsa/icefall /workspace/icefall && \
|
||||||
|
cd /workspace/icefall && \
|
||||||
|
pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
ENV PYTHONPATH /workspace/icefall:$PYTHONPATH
|
||||||
|
|
||||||
|
WORKDIR /workspace/icefall
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user