Return token stop timestamp for CTC decoding. #57
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: flutter-macos | |
on: | |
push: | |
branches: | |
- flutter | |
tags: | |
- '*' | |
paths: | |
- '.github/workflows/flutter-macos.yaml' | |
- 'CMakeLists.txt' | |
- 'cmake/**' | |
- 'sherpa-onnx/csrc/*' | |
- 'sherpa-onnx/c-api/*' | |
- 'sherpa-onnx/flutter/**' | |
pull_request: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/flutter-macos.yaml' | |
- 'CMakeLists.txt' | |
- 'cmake/**' | |
- 'sherpa-onnx/csrc/*' | |
- 'sherpa-onnx/c-api/*' | |
- 'sherpa-onnx/flutter/**' | |
workflow_dispatch: | |
concurrency: | |
group: flutter-macos-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
flutter_macos: | |
name: macos ${{ matrix.arch }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest] | |
arch: [x86_64, arm64] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Flutter SDK | |
uses: flutter-actions/setup-flutter@v3 | |
with: | |
channel: stable | |
version: latest | |
- name: ccache | |
uses: hendrikmuhs/ccache-action@v1.2 | |
with: | |
key: ${{ matrix.os }}-flutter-${{ matrix.arch }} | |
- name: Display PWD | |
shell: bash | |
run: | | |
echo "pwd: $PWD" | |
ls -lh | |
- name: Display machine info | |
shell: bash | |
run: | | |
uname -a | |
- name: Install tree | |
shell: bash | |
run: | | |
brew install tree | |
- name: Display flutter info | |
shell: bash | |
run: | | |
which flutter | |
which dart | |
flutter --version | |
dart --version | |
flutter doctor | |
- name: Configure CMake | |
shell: bash | |
run: | | |
export CMAKE_CXX_COMPILER_LAUNCHER=ccache | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
cmake --version | |
arch=${{ matrix.arch }} | |
mkdir build | |
cd build | |
cmake \ | |
-D BUILD_SHARED_LIBS=ON \ | |
-DCMAKE_OSX_ARCHITECTURES=$arch \ | |
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \ | |
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \ | |
-DBUILD_ESPEAK_NG_EXE=OFF \ | |
-DSHERPA_ONNX_ENABLE_BINARY=OFF \ | |
-DCMAKE_INSTALL_PREFIX=./install \ | |
.. | |
- name: Build sherpa-onnx for macos ${{ matrix.arch }} | |
shell: bash | |
run: | | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
cd build | |
make -j2 | |
make install | |
rm -v ./install/lib/libonnxruntime.dylib | |
- name: Copy libs | |
shell: bash | |
run: | | |
cp -v build/install/lib/lib* ./sherpa-onnx/flutter/macos/ | |
echo "--------------------" | |
ls -lh ./sherpa-onnx/flutter/macos/ | |
- name: Download model files | |
shell: bash | |
run: | | |
cd sherpa-onnx/flutter | |
pushd example/assets | |
# curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/3dspeaker_speech_eres2net_base_sv_zh-cn_3dspeaker_16k.onnx | |
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx | |
# git clone https://github.com/csukuangfj/sr-data | |
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2 | |
tar xvf sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2 | |
rm sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2 | |
cd sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20 | |
rm encoder-epoch-99-avg-1.onnx | |
rm decoder-epoch-99-avg-1.int8.onnx | |
rm joiner-epoch-99-avg-1.onnx | |
rm README.md | |
rm bpe.model | |
rm bpe.vocab | |
rm -rf test_wavs | |
ls -lh | |
cd .. | |
rm -rf sr-data/.git | |
popd | |
- name: Build flutter | |
shell: bash | |
run: | | |
d=$PWD | |
pushd sherpa-onnx/flutter | |
dart pub get | |
cd example | |
export FLUTTER_XCODE_ARCHS=${{ matrix.arch }} | |
echo "FLUTTER_XCODE_ARCHS: $FLUTTER_XCODE_ARCHS" | |
flutter build macos | |
cd build/macos/Build/Products/Release/ | |
tree ./sherpa_onnx.app | |
app=flutter_sherpa_onnx_macos_${{ matrix.arch }}.app | |
mv sherpa_onnx.app $app | |
tar cjfv $app.tar.bz2 $app | |
ls -lh | |
mv $app.tar.bz2 $d | |
popd | |
ls -lh $app.tar.bz2 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: flutter-sherpa-onnx-app-macos-${{ matrix.arch }} | |
path: ./*.tar.bz2 | |
- name: Release android libs | |
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file_glob: true | |
overwrite: true | |
file: flutter*.tar.bz2 |