Add ReazonSpeech Japanese pre-trained model (#1203)
This commit is contained in:
44
.github/scripts/test-offline-transducer.sh
vendored
44
.github/scripts/test-offline-transducer.sh
vendored
@@ -15,6 +15,50 @@ echo "PATH: $PATH"
|
||||
|
||||
which $EXE
|
||||
|
||||
log "------------------------------------------------------------------------"
|
||||
log "Run zipformer transducer models (Japanese from ReazonSpeech) "
|
||||
log "------------------------------------------------------------------------"
|
||||
url=https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-zipformer-ja-reazonspeech-2024-08-01.tar.bz2
|
||||
|
||||
name=$(basename $url)
|
||||
curl -SL -O $url
|
||||
tar xvf $name
|
||||
rm $name
|
||||
repo=$(basename -s .tar.bz2 $name)
|
||||
ls -lh $repo
|
||||
|
||||
cat $repo/test_wavs/*.txt
|
||||
|
||||
log "test $repo"
|
||||
test_wavs=(
|
||||
1.wav
|
||||
2.wav
|
||||
3.wav
|
||||
4.wav
|
||||
5.wav
|
||||
)
|
||||
|
||||
for w in ${test_wavs[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder-epoch-99-avg-1.onnx \
|
||||
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
|
||||
--joiner=$repo/joiner-epoch-99-avg-1.onnx \
|
||||
--debug=1 \
|
||||
$repo/test_wavs/$w
|
||||
done
|
||||
|
||||
for w in ${test_wavs[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder-epoch-99-avg-1.int8.onnx \
|
||||
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
|
||||
--joiner=$repo/joiner-epoch-99-avg-1.int8.onnx \
|
||||
--debug=1 \
|
||||
$repo/test_wavs/$w
|
||||
done
|
||||
rm -rf $repo
|
||||
|
||||
log "------------------------------------------------------------------------"
|
||||
log "Run Nemo fast conformer hybrid transducer ctc models (transducer branch)"
|
||||
log "------------------------------------------------------------------------"
|
||||
|
||||
21
.github/workflows/linux.yaml
vendored
21
.github/workflows/linux.yaml
vendored
@@ -141,6 +141,17 @@ jobs:
|
||||
name: release-${{ matrix.build_type }}-with-shared-lib-${{ matrix.shared_lib }}-with-tts-${{ matrix.with_tts }}
|
||||
path: install/*
|
||||
|
||||
- name: Test offline transducer
|
||||
shell: bash
|
||||
run: |
|
||||
du -h -d1 .
|
||||
export PATH=$PWD/build/bin:$PATH
|
||||
export EXE=sherpa-onnx-offline
|
||||
|
||||
.github/scripts/test-offline-transducer.sh
|
||||
du -h -d1 .
|
||||
|
||||
|
||||
- name: Test offline CTC
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -191,16 +202,6 @@ jobs:
|
||||
.github/scripts/test-online-ctc.sh
|
||||
du -h -d1 .
|
||||
|
||||
- name: Test offline transducer
|
||||
shell: bash
|
||||
run: |
|
||||
du -h -d1 .
|
||||
export PATH=$PWD/build/bin:$PATH
|
||||
export EXE=sherpa-onnx-offline
|
||||
|
||||
.github/scripts/test-offline-transducer.sh
|
||||
du -h -d1 .
|
||||
|
||||
- name: Test C API
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
17
.github/workflows/macos.yaml
vendored
17
.github/workflows/macos.yaml
vendored
@@ -113,14 +113,6 @@ jobs:
|
||||
otool -L build/bin/sherpa-onnx
|
||||
otool -l build/bin/sherpa-onnx
|
||||
|
||||
- name: Test offline CTC
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$PWD/build/bin:$PATH
|
||||
export EXE=sherpa-onnx-offline
|
||||
|
||||
.github/scripts/test-offline-ctc.sh
|
||||
|
||||
- name: Test offline transducer
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -129,6 +121,15 @@ jobs:
|
||||
|
||||
.github/scripts/test-offline-transducer.sh
|
||||
|
||||
|
||||
- name: Test offline CTC
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$PWD/build/bin:$PATH
|
||||
export EXE=sherpa-onnx-offline
|
||||
|
||||
.github/scripts/test-offline-ctc.sh
|
||||
|
||||
- name: Test online CTC
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
@@ -275,6 +275,25 @@ def get_models():
|
||||
|
||||
ls -lh
|
||||
|
||||
popd
|
||||
""",
|
||||
),
|
||||
Model(
|
||||
model_name="sherpa-onnx-zipformer-ja-reazonspeech-2024-08-01",
|
||||
idx=16,
|
||||
lang="ja",
|
||||
short_name="zipformer_reazonspeech",
|
||||
cmd="""
|
||||
pushd $model_name
|
||||
|
||||
rm -rfv test_wavs
|
||||
|
||||
rm -fv encoder-epoch-99-avg-1.onnx
|
||||
rm -fv decoder-epoch-99-avg-1.int8.onnx
|
||||
rm -fv joiner-epoch-99-avg-1.onnx
|
||||
|
||||
ls -lh
|
||||
|
||||
popd
|
||||
""",
|
||||
),
|
||||
|
||||
@@ -338,6 +338,19 @@ fun getOfflineModelConfig(type: Int): OfflineModelConfig? {
|
||||
tokens = "$modelDir/tokens.txt",
|
||||
)
|
||||
}
|
||||
|
||||
16 -> {
|
||||
val modelDir = "sherpa-onnx-zipformer-ja-reazonspeech-2024-08-01"
|
||||
return OfflineModelConfig(
|
||||
transducer = OfflineTransducerModelConfig(
|
||||
encoder = "$modelDir/encoder-epoch-99-avg-1.int8.onnx",
|
||||
decoder = "$modelDir/decoder-epoch-99-avg-1.onnx",
|
||||
joiner = "$modelDir/joiner-epoch-99-avg-1.int8.onnx",
|
||||
),
|
||||
tokens = "$modelDir/tokens.txt",
|
||||
modelType = "transducer",
|
||||
)
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user