Fangjun Kuang
Committed by GitHub

Refactor github actions tests (#688)

正在显示 42 个修改的文件 包含 546 行增加168 行删除
... ... @@ -22,7 +22,7 @@ log "Start testing ${repo_url}"
repo=sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01
log "Download pretrained model and test-data from $repo_url"
wget -qq $repo_url
curl -SL -O $repo_url
tar jxvf ${repo}.tar.bz
time $EXE \
... ... @@ -47,7 +47,7 @@ log "Start testing ${repo_url}"
repo=sherpa-onnx-kws-zipformer-gigaspeech-3.3M-2024-01-01
log "Download pretrained model and test-data from $repo_url"
wget -qq $repo_url
curl -SL -O $repo_url
tar jxvf ${repo}.tar.bz
time $EXE \
... ...
... ... @@ -12,33 +12,46 @@ mkdir -p /tmp/icefall-models
dir=/tmp/icefall-models
pushd $dir
wget -qq https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13.tar.bz2
tar xvf sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13.tar.bz2
rm sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13.tar.bz2
repo=$dir/icefall-asr-librispeech-streaming-zipformer-small-2024-03-18
mkdir -p $repo
cd $repo
mkdir exp-ctc-rnnt-small
cd exp-ctc-rnnt-small
curl -LS -O https://huggingface.co/csukuangfj/icefall-asr-librispeech-streaming-zipformer-small-2024-03-18/resolve/main/exp-ctc-rnnt-small/ctc-epoch-30-avg-3-chunk-16-left-128.int8.onnx
cd ..
mkdir -p data/lang_bpe_500
cd data/lang_bpe_500
curl -LS -O https://huggingface.co/csukuangfj/icefall-asr-librispeech-streaming-zipformer-small-2024-03-18/resolve/main/data/lang_bpe_500/tokens.txt
cd ../..
mkdir test_wavs
cd test_wavs
curl -LS -O https://huggingface.co/csukuangfj/icefall-asr-librispeech-streaming-zipformer-small-2024-03-18/resolve/main/test_wavs/0.wav
curl -LS -O https://huggingface.co/csukuangfj/icefall-asr-librispeech-streaming-zipformer-small-2024-03-18/resolve/main/test_wavs/1.wav
curl -LS -O https://huggingface.co/csukuangfj/icefall-asr-librispeech-streaming-zipformer-small-2024-03-18/resolve/main/test_wavs/8k.wav
popd
repo=$dir/sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13
python3 ./python-api-examples/online-decode-files.py \
--tokens=$repo/tokens.txt \
--zipformer2-ctc=$repo/ctc-epoch-20-avg-1-chunk-16-left-128.onnx \
$repo/test_wavs/DEV_T0000000000.wav \
$repo/test_wavs/DEV_T0000000001.wav \
$repo/test_wavs/DEV_T0000000002.wav
--tokens=$repo/data/lang_bpe_500/tokens.txt \
--zipformer2-ctc=$repo/exp-ctc-rnnt-small/ctc-epoch-30-avg-3-chunk-16-left-128.int8.onnx \
$repo/test_wavs/0.wav \
$repo/test_wavs/1.wav \
$repo/test_wavs/8k.wav
python3 sherpa-onnx/python/tests/test_offline_recognizer.py --verbose
rm -rf $repo
rm -rf $dir/sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13
python3 sherpa-onnx/python/tests/test_offline_recognizer.py --verbose
wenet_models=(
sherpa-onnx-zh-wenet-aishell
sherpa-onnx-zh-wenet-aishell2
sherpa-onnx-zh-wenet-wenetspeech
sherpa-onnx-zh-wenet-multi-cn
# sherpa-onnx-zh-wenet-aishell
# sherpa-onnx-zh-wenet-aishell2
# sherpa-onnx-zh-wenet-wenetspeech
# sherpa-onnx-zh-wenet-multi-cn
sherpa-onnx-en-wenet-librispeech
sherpa-onnx-en-wenet-gigaspeech
)
for name in ${wenet_models[@]}; do
repo_url=https://huggingface.co/csukuangfj/$name
log "Start testing ${repo_url}"
... ... @@ -78,9 +91,9 @@ mkdir ./tts
log "vits-ljs test"
wget -qq https://huggingface.co/csukuangfj/vits-ljs/resolve/main/vits-ljs.onnx
wget -qq https://huggingface.co/csukuangfj/vits-ljs/resolve/main/lexicon.txt
wget -qq https://huggingface.co/csukuangfj/vits-ljs/resolve/main/tokens.txt
curl -LS -O https://huggingface.co/csukuangfj/vits-ljs/resolve/main/vits-ljs.onnx
curl -LS -O https://huggingface.co/csukuangfj/vits-ljs/resolve/main/lexicon.txt
curl -LS -O https://huggingface.co/csukuangfj/vits-ljs/resolve/main/tokens.txt
python3 ./python-api-examples/offline-tts.py \
--vits-model=./vits-ljs.onnx \
... ... @@ -94,9 +107,9 @@ ls -lh ./tts
rm -v vits-ljs.onnx ./lexicon.txt ./tokens.txt
log "vits-vctk test"
wget -qq https://huggingface.co/csukuangfj/vits-vctk/resolve/main/vits-vctk.onnx
wget -qq https://huggingface.co/csukuangfj/vits-vctk/resolve/main/lexicon.txt
wget -qq https://huggingface.co/csukuangfj/vits-vctk/resolve/main/tokens.txt
curl -LS -O https://huggingface.co/csukuangfj/vits-vctk/resolve/main/vits-vctk.onnx
curl -LS -O https://huggingface.co/csukuangfj/vits-vctk/resolve/main/lexicon.txt
curl -LS -O https://huggingface.co/csukuangfj/vits-vctk/resolve/main/tokens.txt
for sid in 0 10 90; do
python3 ./python-api-examples/offline-tts.py \
... ... @@ -110,13 +123,16 @@ done
rm -v vits-vctk.onnx ./lexicon.txt ./tokens.txt
log "vits-zh-aishell3"
if [[ x$OS != x'windows-latest' ]]; then
echo "OS: $OS"
wget -qq https://huggingface.co/csukuangfj/vits-zh-aishell3/resolve/main/vits-aishell3.onnx
wget -qq https://huggingface.co/csukuangfj/vits-zh-aishell3/resolve/main/lexicon.txt
wget -qq https://huggingface.co/csukuangfj/vits-zh-aishell3/resolve/main/tokens.txt
log "vits-zh-aishell3"
for sid in 0 10 90; do
curl -LS -O https://huggingface.co/csukuangfj/vits-zh-aishell3/resolve/main/vits-aishell3.onnx
curl -LS -O https://huggingface.co/csukuangfj/vits-zh-aishell3/resolve/main/lexicon.txt
curl -LS -O https://huggingface.co/csukuangfj/vits-zh-aishell3/resolve/main/tokens.txt
for sid in 0 10 90; do
python3 ./python-api-examples/offline-tts.py \
--vits-model=./vits-aishell3.onnx \
--vits-lexicon=./lexicon.txt \
... ... @@ -124,38 +140,41 @@ for sid in 0 10 90; do
--sid=$sid \
--output-filename=./tts/vits-aishell3-${sid}.wav \
'林美丽最美丽'
done
done
rm -v vits-aishell3.onnx ./lexicon.txt ./tokens.txt
rm -v vits-aishell3.onnx ./lexicon.txt ./tokens.txt
fi
mkdir -p /tmp/icefall-models
dir=/tmp/icefall-models
log "Test streaming transducer models"
pushd $dir
repo_url=https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20
if [[ x$OS != x'windows-latest' ]]; then
echo "OS: $OS"
pushd $dir
repo_url=https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20
log "Start testing ${repo_url}"
repo=$dir/$(basename $repo_url)
log "Download pretrained model and test-data from $repo_url"
log "Start testing ${repo_url}"
repo=$dir/$(basename $repo_url)
log "Download pretrained model and test-data from $repo_url"
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
cd $repo
git lfs pull --include "*.onnx"
popd
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
cd $repo
git lfs pull --include "*.onnx"
popd
python3 -c "import sherpa_onnx; print(sherpa_onnx.__file__)"
sherpa_onnx_version=$(python3 -c "import sherpa_onnx; print(sherpa_onnx.__version__)")
python3 -c "import sherpa_onnx; print(sherpa_onnx.__file__)"
sherpa_onnx_version=$(python3 -c "import sherpa_onnx; print(sherpa_onnx.__version__)")
echo "sherpa_onnx version: $sherpa_onnx_version"
echo "sherpa_onnx version: $sherpa_onnx_version"
pwd
ls -lh
pwd
ls -lh
ls -lh $repo
ls -lh $repo
python3 ./python-api-examples/online-decode-files.py \
python3 ./python-api-examples/online-decode-files.py \
--tokens=$repo/tokens.txt \
--encoder=$repo/encoder-epoch-99-avg-1.onnx \
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
... ... @@ -166,7 +185,7 @@ python3 ./python-api-examples/online-decode-files.py \
$repo/test_wavs/3.wav \
$repo/test_wavs/8k.wav
python3 ./python-api-examples/online-decode-files.py \
python3 ./python-api-examples/online-decode-files.py \
--tokens=$repo/tokens.txt \
--encoder=$repo/encoder-epoch-99-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-99-avg-1.int8.onnx \
... ... @@ -177,7 +196,8 @@ python3 ./python-api-examples/online-decode-files.py \
$repo/test_wavs/3.wav \
$repo/test_wavs/8k.wav
python3 sherpa-onnx/python/tests/test_online_recognizer.py --verbose
python3 sherpa-onnx/python/tests/test_online_recognizer.py --verbose
fi
log "Test non-streaming transducer models"
... ... @@ -219,21 +239,23 @@ rm -rf $repo
log "Test non-streaming paraformer models"
pushd $dir
repo_url=https://huggingface.co/csukuangfj/sherpa-onnx-paraformer-zh-2023-03-28
if [[ x$OS != x'windows-latest' ]]; then
echo "OS: $OS"
pushd $dir
repo_url=https://huggingface.co/csukuangfj/sherpa-onnx-paraformer-zh-2023-03-28
log "Start testing ${repo_url}"
repo=$dir/$(basename $repo_url)
log "Download pretrained model and test-data from $repo_url"
log "Start testing ${repo_url}"
repo=$dir/$(basename $repo_url)
log "Download pretrained model and test-data from $repo_url"
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
cd $repo
git lfs pull --include "*.onnx"
popd
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
cd $repo
git lfs pull --include "*.onnx"
popd
ls -lh $repo
ls -lh $repo
python3 ./python-api-examples/offline-decode-files.py \
python3 ./python-api-examples/offline-decode-files.py \
--tokens=$repo/tokens.txt \
--paraformer=$repo/model.onnx \
$repo/test_wavs/0.wav \
... ... @@ -241,7 +263,7 @@ python3 ./python-api-examples/offline-decode-files.py \
$repo/test_wavs/2.wav \
$repo/test_wavs/8k.wav
python3 ./python-api-examples/offline-decode-files.py \
python3 ./python-api-examples/offline-decode-files.py \
--tokens=$repo/tokens.txt \
--paraformer=$repo/model.int8.onnx \
$repo/test_wavs/0.wav \
... ... @@ -249,9 +271,10 @@ python3 ./python-api-examples/offline-decode-files.py \
$repo/test_wavs/2.wav \
$repo/test_wavs/8k.wav
python3 sherpa-onnx/python/tests/test_offline_recognizer.py --verbose
python3 sherpa-onnx/python/tests/test_offline_recognizer.py --verbose
rm -rf $repo
rm -rf $repo
fi
log "Test non-streaming NeMo CTC models"
... ... @@ -294,8 +317,8 @@ python3 sherpa-onnx/python/tests/test_text2token.py --verbose
rm -rf /tmp/sherpa-test-data
mkdir -p /tmp/onnx-models
dir=/tmp/onnx-models
mkdir -p $dir
log "Test keyword spotting models"
... ... @@ -311,7 +334,7 @@ repo=sherpa-onnx-kws-zipformer-gigaspeech-3.3M-2024-01-01
log "Start testing ${repo}"
pushd $dir
wget -qq https://github.com/pkufool/keyword-spotting-models/releases/download/v0.1/sherpa-onnx-kws-zipformer-gigaspeech-3.3M-2024-01-01.tar.bz
curl -LS -O https://github.com/pkufool/keyword-spotting-models/releases/download/v0.1/sherpa-onnx-kws-zipformer-gigaspeech-3.3M-2024-01-01.tar.bz
tar xf sherpa-onnx-kws-zipformer-gigaspeech-3.3M-2024-01-01.tar.bz
popd
... ... @@ -327,18 +350,23 @@ python3 ./python-api-examples/keyword-spotter.py \
$repo/test_wavs/0.wav \
$repo/test_wavs/1.wav
repo=sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01
log "Start testing ${repo}"
rm -rf $repo
pushd $dir
wget -qq https://github.com/pkufool/keyword-spotting-models/releases/download/v0.1/sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01.tar.bz
tar xf sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01.tar.bz
popd
if [[ x$OS != x'windows-latest' ]]; then
echo "OS: $OS"
repo=$dir/$repo
ls -lh $repo
repo=sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01
log "Start testing ${repo}"
python3 ./python-api-examples/keyword-spotter.py \
pushd $dir
curl -LS -O https://github.com/pkufool/keyword-spotting-models/releases/download/v0.1/sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01.tar.bz
tar xf sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01.tar.bz
popd
repo=$dir/$repo
ls -lh $repo
python3 ./python-api-examples/keyword-spotter.py \
--tokens=$repo/tokens.txt \
--encoder=$repo/encoder-epoch-12-avg-2-chunk-16-left-64.onnx \
--decoder=$repo/decoder-epoch-12-avg-2-chunk-16-left-64.onnx \
... ... @@ -348,6 +376,9 @@ python3 ./python-api-examples/keyword-spotter.py \
$repo/test_wavs/4.wav \
$repo/test_wavs/5.wav
python3 sherpa-onnx/python/tests/test_keyword_spotter.py --verbose
python3 sherpa-onnx/python/tests/test_keyword_spotter.py --verbose
rm -rf $repo
fi
rm -r $dir
... ...
... ... @@ -32,8 +32,8 @@ wespeaker_zh_cnceleb_resnet34.onnx
wespeaker_zh_cnceleb_resnet34_LM.onnx
)
for m in ${models[@]}; do
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/$m
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/wespeaker_en_voxceleb_CAM++_LM.onnx
curl -LS -O https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/$m
curl -LS -O https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/wespeaker_en_voxceleb_CAM++_LM.onnx
done
ls -lh
popd
... ... @@ -52,7 +52,7 @@ models=(
3dspeaker_speech_eres2net_sv_zh-cn_16k-common.onnx
)
for m in ${models[@]}; do
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/$m
curl -LS -O https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/$m
done
ls -lh
popd
... ... @@ -67,7 +67,7 @@ nemo_en_titanet_small.onnx
nemo_en_speakerverification_speakernet.onnx
)
for m in ${models[@]}; do
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/$m
curl -LS -O https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/$m
done
ls -lh
popd
... ...
... ... @@ -9,7 +9,7 @@ ls -lh
mkdir -p /Users/fangjun/Desktop
pushd /Users/fangjun/Desktop
wget -q https://huggingface.co/csukuangfj/test-data/resolve/main/Obama.wav
curl -SL -O https://huggingface.co/csukuangfj/test-data/resolve/main/Obama.wav
ls -lh
popd
... ...
... ... @@ -12,6 +12,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'
pull_request:
branches:
... ... @@ -21,6 +22,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'
workflow_dispatch:
... ... @@ -82,16 +84,16 @@ jobs:
uses: actions/cache@v4
with:
path: toolchain
key: gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz
key: gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz
- name: Download toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
shell: bash
run: |
wget -qq https://huggingface.co/csukuangfj/sherpa-ncnn-toolchains/resolve/main/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz
wget -qq https://huggingface.co/csukuangfj/sherpa-ncnn-toolchains/resolve/main/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz
mkdir $GITHUB_WORKSPACE/toolchain
tar xf ./gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz --strip-components 1 -C $GITHUB_WORKSPACE/toolchain
tar xf ./gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz --strip-components 1 -C $GITHUB_WORKSPACE/toolchain
- name: Set environment variable
if: steps.cache-build-result.outputs.cache-hit != 'true'
... ... @@ -101,19 +103,19 @@ jobs:
echo "$GITHUB_WORKSPACE/bin" >> "$GITHUB_PATH"
ls -lh "$GITHUB_WORKSPACE/toolchain/bin"
echo "CC=aarch64-none-linux-gnu-gcc" >> "$GITHUB_ENV"
echo "CXX=aarch64-none-linux-gnu-g++" >> "$GITHUB_ENV"
echo "CC=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
echo "CXX=aarch64-linux-gnu-g++" >> "$GITHUB_ENV"
- name: Display toolchain info
shell: bash
run: |
aarch64-none-linux-gnu-gcc --version
aarch64-linux-gnu-gcc --version
- name: Display qemu-aarch64 -h
shell: bash
run: |
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-none-linux-gnu/libc
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-linux-gnu/libc
qemu-aarch64 -h
- name: build aarch64-linux-gnu
... ... @@ -138,7 +140,7 @@ jobs:
run: |
export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-none-linux-gnu/libc
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-linux-gnu/libc
ls -lh ./build-aarch64-linux-gnu/bin
... ... @@ -149,7 +151,7 @@ jobs:
- name: Copy files
shell: bash
run: |
aarch64-none-linux-gnu-strip --version
aarch64-linux-gnu-strip --version
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
... ... @@ -164,7 +166,7 @@ jobs:
ls -lh $dst/bin/
echo "strip"
aarch64-none-linux-gnu-strip $dst/bin/*
aarch64-linux-gnu-strip $dst/bin/*
tree $dst
... ... @@ -175,6 +177,38 @@ jobs:
name: sherpa-onnx-linux-aarch64-shared
path: sherpa-onnx-*linux-aarch64-shared.tar.bz2
# https://huggingface.co/docs/hub/spaces-github-actions
- name: Publish to huggingface
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
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
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
cd huggingface
git lfs pull
mkdir -p aarch64
cp -v ../sherpa-onnx-*-shared.tar.bz2 ./aarch64
git status
git lfs track "*.bz2"
git add .
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-aarch64-shared.tar.bz2"
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
- name: Release pre-compiled binaries and libs for aarch64 linux
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
... ...
... ... @@ -12,6 +12,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'
pull_request:
branches:
... ... @@ -21,6 +22,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'
workflow_dispatch:
... ... @@ -166,6 +168,38 @@ jobs:
name: sherpa-onnx-linux-aarch64-static
path: sherpa-onnx-*linux-aarch64-static.tar.bz2
# https://huggingface.co/docs/hub/spaces-github-actions
- name: Publish to huggingface
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
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
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
cd huggingface
git lfs pull
mkdir -p aarch64
cp -v ../sherpa-onnx-*-static.tar.bz2 ./aarch64
git status
git lfs track "*.bz2"
git add .
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-aarch64-static.tar.bz2"
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
- name: Release pre-compiled binaries and libs for aarch64 linux
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
... ...
... ... @@ -25,15 +25,6 @@ on:
- 'build-android*.sh'
workflow_dispatch:
inputs:
release:
description: "Whether to release"
type: boolean
env:
RELEASE:
|- # Release if there is a release tag name or a release flag in workflow_dispatch
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}
concurrency:
group: android-${{ github.ref }}
... ...
... ... @@ -2,8 +2,6 @@ name: apk-kws
on:
push:
branches:
- apk-kws
tags:
- '*'
... ... @@ -17,7 +15,7 @@ permissions:
contents: write
jobs:
apk:
apk_kws:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
... ...
... ... @@ -2,8 +2,6 @@ name: apk-speaker-identification
on:
push:
branches:
- apk
tags:
- '*'
... ... @@ -17,7 +15,7 @@ permissions:
contents: write
jobs:
apk_tts:
apk_speaker_identification:
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
runs-on: ${{ matrix.os }}
name: apk for tts ${{ matrix.index }}/${{ matrix.total }}
... ... @@ -84,18 +82,7 @@ jobs:
ls -lh ./apks/
du -h -d1 .
# - name: Release
# uses: svenstaro/upload-release-action@v2
# with:
# file_glob: true
# file: ./apks/*.apk
# overwrite: true
# repo_name: k2-fsa/sherpa-onnx
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
# tag: speaker-recongition-models
- name: Publish to huggingface
if: true
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
uses: nick-fields/retry@v3
... ...
... ... @@ -2,8 +2,6 @@ name: apk-tts-engine
on:
push:
branches:
- apk-tts
tags:
- '*'
... ...
... ... @@ -2,9 +2,6 @@ name: apk-tts
on:
push:
branches:
- apk-tts
- apk
tags:
- '*'
... ...
... ... @@ -2,8 +2,6 @@ name: apk
on:
push:
branches:
- apk
tags:
- '*'
... ...
... ... @@ -10,6 +10,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'toolchains/arm-linux-gnueabihf.toolchain.cmake'
tags:
- '*'
... ... @@ -21,6 +22,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'toolchains/arm-linux-gnueabihf.toolchain.cmake'
workflow_dispatch:
... ... @@ -189,6 +191,38 @@ jobs:
name: sherpa-onnx-linux-arm-gnueabihf-static
path: sherpa-onnx-*linux-arm-gnueabihf-static.tar.bz2
# https://huggingface.co/docs/hub/spaces-github-actions
- name: Publish to huggingface
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
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
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
cd huggingface
git lfs pull
mkdir -p arm32
cp -v ../sherpa-onnx-*.tar.bz2 ./arm32
git status
git lfs track "*.bz2"
git add .
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}"
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
- name: Release pre-compiled binaries and libs for arm linux gnueabihf ${{ matrix.lib_type }}
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
... ...
... ... @@ -2,8 +2,6 @@ name: build-wheels-aarch64
on:
push:
branches:
- wheel
tags:
- '*'
workflow_dispatch:
... ... @@ -61,10 +59,8 @@ jobs:
run: |
ls -lh ./wheelhouse/
ls -lh ./wheelhouse/*.whl
- name: Publish to huggingface
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux_2_28'
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux2014'
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
uses: nick-fields/retry@v3
... ...
... ... @@ -2,8 +2,6 @@ name: build-wheels-armv7l
on:
push:
branches:
- wheel
tags:
- '*'
workflow_dispatch:
... ...
... ... @@ -2,8 +2,6 @@ name: build-wheels-linux
on:
push:
branches:
- wheel
tags:
- '*'
workflow_dispatch:
... ... @@ -12,7 +10,7 @@ env:
SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1
concurrency:
group: build-wheels-${{ github.ref }}
group: build-wheels-linux-${{ github.ref }}
cancel-in-progress: true
jobs:
... ... @@ -84,6 +82,7 @@ jobs:
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
uses: nick-fields/retry@v3
shell: bash
with:
max_attempts: 20
timeout_seconds: 200
... ... @@ -112,6 +111,7 @@ jobs:
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
shell: bash
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel twine setuptools
... ... @@ -119,16 +119,17 @@ jobs:
twine upload ./wheelhouse/*.whl
- name: Build sdist
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux_2_28'
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux2014'
shell: bash
run: |
python3 setup.py sdist
ls -l dist/*
- name: Publish sdist to PyPI
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux_2_28'
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux2014'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
shell: bash
run: |
twine upload dist/sherpa-onnx-*.tar.gz
... ...
... ... @@ -2,8 +2,6 @@ name: build-wheels-macos-arm64
on:
push:
branches:
- wheel
tags:
- '*'
workflow_dispatch:
... ... @@ -16,7 +14,7 @@ concurrency:
cancel-in-progress: true
jobs:
build_wheels:
build_wheels_macos_arm64:
name: ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
... ... @@ -34,6 +32,7 @@ jobs:
if: matrix.python-version == 'cp37'
uses: pypa/cibuildwheel@v2.11.4
env:
CIBW_BUILD: "${{ matrix.python-version}}-* "
CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64'"
CIBW_ARCHS: "arm64"
CIBW_BUILD_VERBOSITY: 3
... ... @@ -58,8 +57,6 @@ jobs:
run: |
ls -lh ./wheelhouse/
ls -lh ./wheelhouse/*.whl
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python-version }}
... ...
... ... @@ -16,7 +16,7 @@ concurrency:
cancel-in-progress: true
jobs:
build_wheels:
build_wheels_macos_x64:
name: ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
... ... @@ -41,6 +41,7 @@ jobs:
# Don't repair macOS wheels
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
- name: Build wheels
if: matrix.python-version != 'cp37'
uses: pypa/cibuildwheel@v2.15.0
... ...
... ... @@ -2,8 +2,6 @@ name: build-wheels-win32
on:
push:
branches:
- wheel
tags:
- '*'
workflow_dispatch:
... ...
... ... @@ -42,8 +42,6 @@ jobs:
run: |
ls -lh ./wheelhouse/
ls -lh ./wheelhouse/*.whl
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python-version }}
... ...
... ... @@ -4,11 +4,25 @@ on:
push:
branches:
- master
- xcframework
paths:
- './build-ios.sh'
- '.github/workflows/build-xcframework.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
tags:
- '*'
pull_request:
branches:
- master
paths:
- './build-ios.sh'
- '.github/workflows/build-xcframework.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
workflow_dispatch:
... ...
... ... @@ -50,7 +50,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
build_type: [Release, Debug]
# build_type: [Release, Debug]
build_type: [Release]
steps:
- uses: actions/checkout@v4
... ...
... ... @@ -18,6 +18,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
pull_request:
branches:
- master
... ... @@ -33,6 +34,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
workflow_dispatch:
... ...
... ... @@ -12,6 +12,7 @@ on:
- 'cmake/**'
- 'mfc-examples/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
pull_request:
branches:
- master
... ... @@ -21,6 +22,7 @@ on:
- 'cmake/**'
- 'mfc-examples/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
workflow_dispatch:
... ...
name: nightly-wheel-arm
on:
push:
branches:
- master
- nightly
schedule:
# minute (0-59)
# hour (0-23)
... ...
... ... @@ -9,6 +9,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'toolchains/riscv64-linux-gnu.toolchain.cmake'
- 'build-riscv64-linux-gnu.sh'
tags:
... ... @@ -22,6 +23,7 @@ on:
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'toolchains/riscv64-linux-gnu.toolchain.cmake'
- 'sherpa-onnx/c-api/*'
- 'build-riscv64-linux-gnu.sh'
workflow_dispatch:
... ... @@ -194,6 +196,8 @@ jobs:
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-riscv64-${{ matrix.lib_type }}
mkdir $dst
cp -v $GITHUB_WORKSPACE/toolchain/sysroot/lib/ld-linux-riscv64xthead-lp64d.so.1 build-riscv64-linux-gnu/install/lib/
ls -lh build-riscv64-linux-gnu/install/lib
cp -a build-riscv64-linux-gnu/install/bin $dst/
... ... @@ -219,6 +223,39 @@ jobs:
name: sherpa-onnx-linux-riscv64-shared
path: sherpa-onnx-*linux-riscv64-shared.tar.bz2
# https://huggingface.co/docs/hub/spaces-github-actions
- name: Publish to huggingface
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
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
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
cd huggingface
git lfs pull
mkdir -p riscv64
cp -v ../sherpa-onnx-*-shared.tar.bz2 ./riscv64
git status
git lfs track "*.bz2"
git add .
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-riscv64-shared.tar.bz2"
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
- uses: actions/upload-artifact@v4
if: matrix.lib_type == 'shared'
with:
... ...
... ... @@ -30,19 +30,25 @@ concurrency:
permissions:
contents: read
env:
SCCACHE_GHA_ENABLED: "true"
jobs:
run-python-test:
name: ${{ matrix.os }} ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest] # windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10","3.11", "3.12"]
exclude:
- os: macos-latest
python-version: "3.9"
- os: macos-latest
python-version: "3.10"
# - os: windows-latest
# python-version: "3.12"
steps:
- uses: actions/checkout@v4
... ... @@ -50,10 +56,17 @@ jobs:
fetch-depth: 0
- name: ccache
if: matrix.os != 'windows-latest'
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.os }}-python-${{ matrix.python-version }}
- name: Run sccache-cache
if: matrix.os == 'windows-latest'
uses: mozilla-actions/sccache-action@v0.0.3
with:
version: "v0.7.4"
- name: Setup Python
uses: actions/setup-python@v5
with:
... ... @@ -62,9 +75,10 @@ jobs:
- name: Install Python dependencies
shell: bash
run: |
python3 -m pip install --upgrade pip numpy pypinyin sentencepiece==0.1.96 soundfile
python3 -m pip install --upgrade pip numpy pypinyin sentencepiece>=0.1.96 soundfile
- name: Install sherpa-onnx
if: matrix.os != 'windows-latest'
shell: bash
run: |
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
... ... @@ -73,11 +87,22 @@ jobs:
python3 -m pip install --verbose .
- name: Install sherpa-onnx
if: matrix.os == 'windows-latest'
shell: bash
run: |
cmake --version
export SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache"
echo "SHERPA_ONNX_CMAKE_ARGS: ${SHERPA_ONNX_CMAKE_ARGS}"
python3 -m pip install --verbose .
- name: Test sherpa-onnx
shell: bash
run: |
.github/scripts/test-speaker-recognition-python.sh
export OS=${{ matrix.os }}
.github/scripts/test-python.sh
.github/scripts/test-speaker-recognition-python.sh
- uses: actions/upload-artifact@v4
with:
... ...
... ... @@ -4,10 +4,28 @@ on:
push:
branches:
- master
paths:
- './build-swift-macos.sh'
- '.github/workflows/swift.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'swift-api-examples/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/**'
- '.github/scripts/test-swift.sh'
pull_request:
branches:
- master
paths:
- './build-swift-macos.sh'
- '.github/workflows/swift.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'swift-api-examples/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/**'
- '.github/scripts/test-swift.sh'
workflow_dispatch:
... ...
... ... @@ -4,8 +4,23 @@ on:
push:
branches:
- master
paths:
- 'setup.py'
- '.github/workflows/test-build-wheel.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/python/**'
pull_request:
branches:
- master
paths:
- 'setup.py'
- '.github/workflows/test-build-wheel.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/python/**'
workflow_dispatch:
... ... @@ -15,13 +30,13 @@ concurrency:
jobs:
test-build-wheel:
name: ${{ matrix.os }} ${{ matrix.python_version }}
name: ${{ matrix.os }} ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
... ... @@ -75,6 +90,7 @@ jobs:
export PATH=/c/hostedtoolcache/windows/Python/3.9.13/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.10.11/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.11.8/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.12.2/x64/bin:$PATH
which sherpa-onnx
sherpa-onnx --help
... ...
... ... @@ -4,10 +4,24 @@ on:
push:
branches:
- master
paths:
- '.github/workflows/test-dot-net.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'dotnet-examples/**'
- 'scripts/dotnet/**'
pull_request:
branches:
- master
paths:
- '.github/workflows/test-dot-net.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'dotnet-examples/**'
- 'scripts/dotnet/**'
workflow_dispatch:
... ...
... ... @@ -4,9 +4,23 @@ on:
push:
branches:
- master
paths:
- '.github/workflows/test-go.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'go-api-examples/**'
- 'scripts/go/**'
pull_request:
branches:
- master
paths:
- '.github/workflows/test-go.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'go-api-examples/**'
- 'scripts/go/**'
workflow_dispatch:
... ...
... ... @@ -4,10 +4,26 @@ on:
push:
branches:
- master
paths:
- '.github/workflows/test-nodejs.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'scripts/nodejs/**'
- 'nodejs-examples/**'
pull_request:
branches:
- master
paths:
- '.github/workflows/test-nodejs.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'scripts/nodejs/**'
- 'nodejs-examples/**'
workflow_dispatch:
... ...
... ... @@ -29,7 +29,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- os: macos-latest
python-version: "3.7"
... ... @@ -68,6 +68,7 @@ jobs:
export PATH=/c/hostedtoolcache/windows/Python/3.9.13/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.10.11/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.11.8/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.12.2/x64/bin:$PATH
sherpa-onnx --help
sherpa-onnx-keyword-spotter --help
... ...
... ... @@ -3,6 +3,19 @@ on:
push:
branches:
- master
paths:
- '.github/workflows/test-piper-phonemize.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
pull_request:
branches:
- master
paths:
- '.github/workflows/test-piper-phonemize.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
workflow_dispatch:
... ... @@ -10,7 +23,6 @@ concurrency:
group: test-piper-phonemize-${{ github.ref }}
cancel-in-progress: true
jobs:
test_piper_phonemize:
name: ${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.shared_lib }}
... ...
... ... @@ -4,9 +4,21 @@ on:
push:
branches:
- master
paths:
- '.github/workflows/test-python-offline-websocket-server.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/python/**'
pull_request:
branches:
- master
paths:
- '.github/workflows/test-python-offline-websocket-server.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/python/**'
workflow_dispatch:
concurrency:
... ...
... ... @@ -4,9 +4,21 @@ on:
push:
branches:
- master
paths:
- '.github/workflows/test-python-online-websocket-server.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/python/**'
pull_request:
branches:
- master
paths:
- '.github/workflows/test-python-online-websocket-server.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/python/**'
workflow_dispatch:
concurrency:
... ...
... ... @@ -40,7 +40,7 @@ concurrency:
jobs:
windows_x64:
name: Windows x64
name: ${{ matrix.shared_lib }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
... ... @@ -59,7 +59,6 @@ jobs:
mkdir build
cd build
cmake -A x64 -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} -DCMAKE_INSTALL_PREFIX=./install ..
- name: Build sherpa-onnx for windows
shell: bash
run: |
... ... @@ -134,12 +133,17 @@ jobs:
.github/scripts/test-online-transducer.sh
- name: Copy files
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
shell: bash
run: |
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x64
shared_lib=${{ matrix.shared_lib }}
if [[ $shared_lib == "ON" ]]; then
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x64-shared
else
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x64-static
fi
mkdir $dst
cp -a build/install/bin $dst/
... ... @@ -148,10 +152,42 @@ jobs:
tar cjvf ${dst}.tar.bz2 $dst
# https://huggingface.co/docs/hub/spaces-github-actions
- name: Publish to huggingface
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
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
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
cd huggingface
git lfs pull
mkdir -p win64
cp -v ../sherpa-onnx-*.tar.bz2 ./win64
git status
git lfs track "*.bz2"
git add .
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}"
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
- name: Release pre-compiled binaries and libs for Windows x64
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: sherpa-onnx-*-win-x64.tar.bz2
file: sherpa-onnx-*-win-x64*.tar.bz2
... ...
... ... @@ -134,12 +134,19 @@ jobs:
.github/scripts/test-online-transducer.sh
- name: Copy files
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
shell: bash
run: |
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x86
shared_lib=${{ matrix.shared_lib }}
if [[ $shared_lib == "ON" ]]; then
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x86-shared
else
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x86-static
fi
mkdir $dst
cp -a build/install/bin $dst/
... ... @@ -148,10 +155,42 @@ jobs:
tar cjvf ${dst}.tar.bz2 $dst
# https://huggingface.co/docs/hub/spaces-github-actions
- name: Publish to huggingface
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
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
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
cd huggingface
git lfs pull
mkdir -p win32
cp -v ../sherpa-onnx-*.tar.bz2 ./win32
git status
git lfs track "*.bz2"
git add .
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}"
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
- name: Release pre-compiled binaries and libs for Windows x86
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: sherpa-onnx-*-win-x86.tar.bz2
file: sherpa-onnx-*-win-x86*.tar.bz2
... ...
... ... @@ -68,6 +68,12 @@ class OfflineDecodeFiles
It specifies number of active paths to keep during the search")]
public int MaxActivePaths { get; set; }
[Option("hotwords-file", Required = false, Default = "", HelpText = "Path to hotwords.txt")]
public string HotwordsFile { get; set; }
[Option("hotwords-score", Required = false, Default = 1.5F, HelpText = "hotwords score")]
public float HotwordsScore { get; set; }
[Option("files", Required = true, HelpText = "Audio files for decoding")]
public IEnumerable<string> Files { get; set; }
}
... ... @@ -214,6 +220,9 @@ to download pre-trained Tdnn models.
config.DecodingMethod = options.DecodingMethod;
config.MaxActivePaths = options.MaxActivePaths;
config.HotwordsFile = options.HotwordsFile;
config.HotwordsScore = options.HotwordsScore;
config.ModelConfig.Debug = 0;
OfflineRecognizer recognizer = new OfflineRecognizer(config);
... ...
... ... @@ -79,6 +79,13 @@ only when --enable-endpoint is true.")]
larger than this value. Used only when --enable-endpoint is true.")]
public float Rule3MinUtteranceLength { get; set; }
[Option("hotwords-file", Required = false, Default = "", HelpText = "Path to hotwords.txt")]
public string HotwordsFile { get; set; }
[Option("hotwords-score", Required = false, Default = 1.5F, HelpText = "hotwords score")]
public float HotwordsScore { get; set; }
[Option("files", Required = true, HelpText = "Audio files for decoding")]
public IEnumerable<string> Files { get; set; }
... ... @@ -180,6 +187,8 @@ to download pre-trained streaming models.
config.Rule1MinTrailingSilence = options.Rule1MinTrailingSilence;
config.Rule2MinTrailingSilence = options.Rule2MinTrailingSilence;
config.Rule3MinUtteranceLength = options.Rule3MinUtteranceLength;
config.HotwordsFile = options.HotwordsFile;
config.HotwordsScore = options.HotwordsScore;
OnlineRecognizer recognizer = new OnlineRecognizer(config);
... ...
... ... @@ -2,4 +2,6 @@ all
macos
linux
windows
windows-x64
windows-x86
packages
... ...
... ... @@ -130,7 +130,7 @@ namespace SherpaOnnx
Rule2MinTrailingSilence = 2.4F;
Rule3MinUtteranceLength = 20.0F;
HotwordsFile = "";
HotwordsScore = 2F;
HotwordsScore = 1.5F;
}
public FeatureConfig FeatConfig;
public OnlineModelConfig ModelConfig;
... ...