# 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] jobs: run_librispeech_2022_03_12: if: github.event.label.name == 'ready' || github.event_name == 'push' runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-18.04] python-version: [3.7, 3.8, 3.9] fail-fast: false steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - name: Install graphviz shell: bash run: | sudo apt-get -qq install graphviz - 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 - name: Cache kaldifeat id: my-cache uses: actions/cache@v2 with: path: | ~/tmp/kaldifeat key: cache-tmp-${{ matrix.python-version }} - name: Install kaldifeat if: steps.my-cache.outputs.cache-hit != 'true' shell: bash run: | mkdir -p ~/tmp cd ~/tmp git clone https://github.com/csukuangfj/kaldifeat cd kaldifeat mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release .. make -j2 _kaldifeat - name: Download pre-trained model shell: bash run: | sudo apt-get -qq install git-lfs mkdir -p ~/tmp cd ~/tmp git lfs install git clone https://huggingface.co/csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless-2022-03-12 - name: Display test files shell: bash run: | sudo apt-get -qq install tree sox tree ~/tmp/icefall-asr-librispeech-pruned-transducer-stateless-2022-03-12 soxi ~/tmp/icefall-asr-librispeech-pruned-transducer-stateless-2022-03-12/test_wavs/*.wav ls -lh ~/tmp/icefall-asr-librispeech-pruned-transducer-stateless-2022-03-12/test_wavs/*.wav - name: Run greedy search decoding (max-sym-per-frame 1) shell: bash run: | export PYTHONPATH=$PWD:$PYTHONPATH export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH dir=~/tmp/icefall-asr-librispeech-pruned-transducer-stateless-2022-03-12 cd egs/librispeech/ASR ./pruned_transducer_stateless/pretrained.py \ --method greedy_search \ --max-sym-per-frame 1 \ --checkpoint $dir/exp/pretrained.pt \ --bpe-model $dir/data/lang_bpe_500/bpe.model \ $dir/test_wavs/1089-134686-0001.wav \ $dir/test_wavs/1221-135766-0001.wav \ $dir/test_wavs/1221-135766-0002.wav - name: Run greedy search decoding (max-sym-per-frame 2) shell: bash run: | export PYTHONPATH=$PWD:$PYTHONPATH export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH dir=~/tmp/icefall-asr-librispeech-pruned-transducer-stateless-2022-03-12 cd egs/librispeech/ASR ./pruned_transducer_stateless/pretrained.py \ --method greedy_search \ --max-sym-per-frame 2 \ --checkpoint $dir/exp/pretrained.pt \ --bpe-model $dir/data/lang_bpe_500/bpe.model \ $dir/test_wavs/1089-134686-0001.wav \ $dir/test_wavs/1221-135766-0001.wav \ $dir/test_wavs/1221-135766-0002.wav - name: Run greedy search decoding (max-sym-per-frame 3) shell: bash run: | export PYTHONPATH=$PWD:$PYTHONPATH export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH dir=~/tmp/icefall-asr-librispeech-pruned-transducer-stateless-2022-03-12 cd egs/librispeech/ASR ./pruned_transducer_stateless/pretrained.py \ --method greedy_search \ --max-sym-per-frame 3 \ --checkpoint $dir/exp/pretrained.pt \ --bpe-model $dir/data/lang_bpe_500/bpe.model \ $dir/test_wavs/1089-134686-0001.wav \ $dir/test_wavs/1221-135766-0001.wav \ $dir/test_wavs/1221-135766-0002.wav - name: Run beam search decoding shell: bash run: | export PYTHONPATH=$PWD:$PYTHONPATH export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH dir=~/tmp/icefall-asr-librispeech-pruned-transducer-stateless-2022-03-12 cd egs/librispeech/ASR ./pruned_transducer_stateless/pretrained.py \ --method beam_search \ --beam-size 4 \ --checkpoint $dir/exp/pretrained.pt \ --bpe-model $dir/data/lang_bpe_500/bpe.model \ $dir/test_wavs/1089-134686-0001.wav \ $dir/test_wavs/1221-135766-0001.wav \ $dir/test_wavs/1221-135766-0002.wav - name: Run modified beam search decoding shell: bash run: | export PYTHONPATH=$PWD:$PYTHONPATH export PYTHONPATH=~/tmp/kaldifeat/kaldifeat/python:$PYTHONPATH export PYTHONPATH=~/tmp/kaldifeat/build/lib:$PYTHONPATH dir=~/tmp/icefall-asr-librispeech-pruned-transducer-stateless-2022-03-12 cd egs/librispeech/ASR ./pruned_transducer_stateless/pretrained.py \ --method modified_beam_search \ --beam-size 4 \ --checkpoint $dir/exp/pretrained.pt \ --bpe-model $dir/data/lang_bpe_500/bpe.model \ $dir/test_wavs/1089-134686-0001.wav \ $dir/test_wavs/1221-135766-0001.wav \ $dir/test_wavs/1221-135766-0002.wav