Export non-streaming NeMo faster conformer hybrid transducer and ctc to sherpa-onnx (#847)

This commit is contained in:
Fangjun Kuang
2024-05-09 13:59:47 +08:00
committed by GitHub
parent 68b25abf27
commit 5ed3ec1c04
16 changed files with 1055 additions and 20 deletions

View File

@@ -0,0 +1,67 @@
name: export-nemo-fast-conformer-ctc-non-streaming
on:
workflow_dispatch:
concurrency:
group: export-nemo-fast-conformer-hybrid-transducer-ctc-non-streaming-${{ github.ref }}
cancel-in-progress: true
jobs:
export-nemo-fast-conformer-hybrid-transducer-ctc-non-streaming:
if: github.repository_owner == 'k2-fsa' || github.repository_owner == 'csukuangfj'
name: Hybrid ctc non-streaming
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install NeMo
shell: bash
run: |
BRANCH='main'
pip install git+https://github.com/NVIDIA/NeMo.git@$BRANCH#egg=nemo_toolkit[asr]
pip install onnxruntime
pip install kaldi-native-fbank
pip install soundfile librosa
- name: Run
shell: bash
run: |
cd scripts/nemo/fast-conformer-hybrid-transducer-ctc
./run-ctc-non-streaming.sh
mv -v sherpa-onnx-nemo* ../../..
- name: Compress files
shell: bash
run: |
dirs=(
sherpa-onnx-nemo-fast-conformer-ctc-en-24500
sherpa-onnx-nemo-fast-conformer-ctc-es-1424
sherpa-onnx-nemo-fast-conformer-ctc-en-de-es-fr-14288
sherpa-onnx-nemo-fast-conformer-ctc-be-de-en-es-fr-hr-it-pl-ru-uk-20k
)
for d in ${dirs[@]}; do
tar cjvf ${d}.tar.bz2 ./$d
done
- name: Release
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

View File

@@ -10,7 +10,7 @@ concurrency:
jobs:
export-nemo-fast-conformer-hybrid-transducer-ctc-to-onnx:
if: github.repository_owner == 'k2-fsa' || github.repository_owner == 'csukuangfj'
name: export NeMo fast conformer
name: Hybrid ctc streaming
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
@@ -54,13 +54,13 @@ jobs:
curl -SL -O https://hf-mirror.com/csukuangfj/sherpa-onnx-nemo-ctc-en-conformer-small/resolve/main/test_wavs/trans.txt
popd
cp -av test_wavs ./sherpa-onnx-nemo-streaming-fast-conformer-ctc-80ms
cp -av test_wavs ./sherpa-onnx-nemo-streaming-fast-conformer-ctc-480ms
cp -av test_wavs ./sherpa-onnx-nemo-streaming-fast-conformer-ctc-1040ms
cp -av test_wavs ./sherpa-onnx-nemo-streaming-fast-conformer-ctc-en-80ms
cp -av test_wavs ./sherpa-onnx-nemo-streaming-fast-conformer-ctc-en-480ms
cp -av test_wavs ./sherpa-onnx-nemo-streaming-fast-conformer-ctc-en-1040ms
tar cjvf sherpa-onnx-nemo-streaming-fast-conformer-ctc-80ms.tar.bz2 sherpa-onnx-nemo-streaming-fast-conformer-ctc-80ms
tar cjvf sherpa-onnx-nemo-streaming-fast-conformer-ctc-480ms.tar.bz2 sherpa-onnx-nemo-streaming-fast-conformer-ctc-480ms
tar cjvf sherpa-onnx-nemo-streaming-fast-conformer-ctc-1040ms.tar.bz2 sherpa-onnx-nemo-streaming-fast-conformer-ctc-1040ms
tar cjvf sherpa-onnx-nemo-streaming-fast-conformer-ctc-en-80ms.tar.bz2 sherpa-onnx-nemo-streaming-fast-conformer-ctc-en-80ms
tar cjvf sherpa-onnx-nemo-streaming-fast-conformer-ctc-en-480ms.tar.bz2 sherpa-onnx-nemo-streaming-fast-conformer-ctc-en-480ms
tar cjvf sherpa-onnx-nemo-streaming-fast-conformer-ctc-en-1040ms.tar.bz2 sherpa-onnx-nemo-streaming-fast-conformer-ctc-en-1040ms
- name: Release
uses: svenstaro/upload-release-action@v2

View File

@@ -0,0 +1,67 @@
name: export-nemo-fast-conformer-transducer-non-streaming
on:
workflow_dispatch:
concurrency:
group: export-nemo-fast-conformer-hybrid-transducer-transducer-non-streaming-${{ github.ref }}
cancel-in-progress: true
jobs:
export-nemo-fast-conformer-hybrid-transducer-transducer-non-streaming:
if: github.repository_owner == 'k2-fsa' || github.repository_owner == 'csukuangfj'
name: Hybrid transducer non-streaming
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install NeMo
shell: bash
run: |
BRANCH='main'
pip install git+https://github.com/NVIDIA/NeMo.git@$BRANCH#egg=nemo_toolkit[asr]
pip install onnxruntime
pip install kaldi-native-fbank
pip install soundfile librosa
- name: Run
shell: bash
run: |
cd scripts/nemo/fast-conformer-hybrid-transducer-ctc
./run-transducer-non-streaming.sh
mv -v sherpa-onnx-nemo* ../../..
- name: Compress files
shell: bash
run: |
dirs=(
sherpa-onnx-nemo-fast-conformer-transducer-en-24500
sherpa-onnx-nemo-fast-conformer-transducer-es-1424
sherpa-onnx-nemo-fast-conformer-transducer-en-de-es-fr-14288
sherpa-onnx-nemo-fast-conformer-transducer-be-de-en-es-fr-hr-it-pl-ru-uk-20k
)
for d in ${dirs[@]}; do
tar cjvf ${d}.tar.bz2 ./$d
done
- name: Release
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

View File

@@ -10,7 +10,7 @@ concurrency:
jobs:
export-nemo-fast-conformer-hybrid-transducer-to-onnx:
if: github.repository_owner == 'k2-fsa' || github.repository_owner == 'csukuangfj'
name: NeMo transducer
name: Hybrid transducer streaming
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
@@ -54,13 +54,13 @@ jobs:
curl -SL -O https://hf-mirror.com/csukuangfj/sherpa-onnx-nemo-ctc-en-conformer-small/resolve/main/test_wavs/trans.txt
popd
cp -av test_wavs ./sherpa-onnx-nemo-streaming-fast-conformer-transducer-80ms
cp -av test_wavs ./sherpa-onnx-nemo-streaming-fast-conformer-transducer-480ms
cp -av test_wavs ./sherpa-onnx-nemo-streaming-fast-conformer-transducer-1040ms
cp -av test_wavs ./sherpa-onnx-nemo-streaming-fast-conformer-transducer-en-80ms
cp -av test_wavs ./sherpa-onnx-nemo-streaming-fast-conformer-transducer-en-480ms
cp -av test_wavs ./sherpa-onnx-nemo-streaming-fast-conformer-transducer-en-1040ms
tar cjvf sherpa-onnx-nemo-streaming-fast-conformer-transducer-80ms.tar.bz2 sherpa-onnx-nemo-streaming-fast-conformer-transducer-80ms
tar cjvf sherpa-onnx-nemo-streaming-fast-conformer-transducer-480ms.tar.bz2 sherpa-onnx-nemo-streaming-fast-conformer-transducer-480ms
tar cjvf sherpa-onnx-nemo-streaming-fast-conformer-transducer-1040ms.tar.bz2 sherpa-onnx-nemo-streaming-fast-conformer-transducer-1040ms
tar cjvf sherpa-onnx-nemo-streaming-fast-conformer-transducer-en-80ms.tar.bz2 sherpa-onnx-nemo-streaming-fast-conformer-transducer-en-80ms
tar cjvf sherpa-onnx-nemo-streaming-fast-conformer-transducer-en-480ms.tar.bz2 sherpa-onnx-nemo-streaming-fast-conformer-transducer-en-480ms
tar cjvf sherpa-onnx-nemo-streaming-fast-conformer-transducer-en-1040ms.tar.bz2 sherpa-onnx-nemo-streaming-fast-conformer-transducer-en-1040ms
- name: Release
uses: svenstaro/upload-release-action@v2