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