mirror of
https://github.com/k2-fsa/sherpa-onnx.git
synced 2026-11-10 13:04:05 +08:00
Remove espeak-ng and piper-phonemize from sherpa-onnx (#4055)
Fixes #3731 espeak-ng and piper-phonemize are no longer built into sherpa-onnx. Text frontends are now: - **lexicon** — built in, no extra dependency - **phonemize** — phonemize outside sherpa-onnx (e.g. [piper-phonemize](https://github.com/csukuangfj/piper-phonemize)) and pass the result in. That library is GPL, so it stays optional: sherpa-onnx is GPL-free after this PR. ## API - `SherpaOnnxGenerationConfig` gains `phoneme_codepoints` and `tokens` (mutually exclusive alternatives to `text`) - `data_dir` on the TTS model configs is deprecated and ignored; the ABI slot is kept - all bindings updated: C/C++, Python, Java, Kotlin, Go, Rust, C#, Swift, Pascal, Dart/Flutter, node-addon, WASM, HarmonyOS
This commit is contained in:
1 parent
1a9d234ab9
commit
0b3647632f
645 files changed
+22846
-10937
No files matched your search
@@ -9,6 +9,49 @@ log() {
|
||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
||||
}
|
||||
|
||||
# --- Extracted-model cleanup ---------------------------------------------
|
||||
# Test scripts download large ASR models. Each script normally ends with an
|
||||
# `rm -rf $repo`, but if the script aborts early (e.g. `set -e` when a test
|
||||
# fails, or a download/extract error) that line never runs and the model is
|
||||
# left on disk. Across the many test steps in a single CI job this fills the
|
||||
# runner's disk. To avoid that, download_and_extract registers every extracted
|
||||
# top-level path here and they are all removed when the script exits, whether
|
||||
# it succeeded or failed.
|
||||
_sherpa_cleanup_dirs=()
|
||||
_sherpa_cleanup_saved_exit_trap=""
|
||||
_sherpa_cleanup_installed=0
|
||||
|
||||
_sherpa_cleanup_on_exit() {
|
||||
local d
|
||||
for d in ${_sherpa_cleanup_dirs[@]+"${_sherpa_cleanup_dirs[@]}"}; do
|
||||
if [ -n "$d" ] && [ -e "$d" ]; then
|
||||
log "Cleaning up extracted model: $d"
|
||||
rm -rf "$d"
|
||||
fi
|
||||
done
|
||||
# Run any EXIT trap that was installed before ours (e.g. test-rust.sh's
|
||||
# diagnostic trap) so we never clobber another script's cleanup.
|
||||
if [ -n "$_sherpa_cleanup_saved_exit_trap" ]; then
|
||||
eval "$_sherpa_cleanup_saved_exit_trap"
|
||||
fi
|
||||
}
|
||||
|
||||
_sherpa_register_cleanup() {
|
||||
_sherpa_cleanup_dirs+=("$1")
|
||||
if [ "$_sherpa_cleanup_installed" -eq 0 ]; then
|
||||
_sherpa_cleanup_installed=1
|
||||
# Save whatever EXIT trap is currently installed so ours can chain to it.
|
||||
local saved
|
||||
saved="$(trap -p EXIT)"
|
||||
if [ -n "$saved" ]; then
|
||||
# saved looks like: trap -- 'some command' EXIT
|
||||
_sherpa_cleanup_saved_exit_trap="${saved#trap -- \'}"
|
||||
_sherpa_cleanup_saved_exit_trap="${_sherpa_cleanup_saved_exit_trap%\' EXIT}"
|
||||
fi
|
||||
trap _sherpa_cleanup_on_exit EXIT
|
||||
fi
|
||||
}
|
||||
|
||||
# Download a file with retry logic and validation
|
||||
# Validates that downloaded files are not empty and not HTML error pages
|
||||
# Retries with random sleep (1-10 seconds) between attempts
|
||||
@@ -101,11 +144,21 @@ download_and_extract() {
|
||||
fi
|
||||
|
||||
# Extract based on file extension
|
||||
# Compute the top-level name the archive extracts to (release model
|
||||
# archives are named after the directory they contain) so we can clean it
|
||||
# up automatically when the script exits.
|
||||
local extracted="$filename"
|
||||
extracted="${extracted%.tar.bz2}"; extracted="${extracted%.tar.bz}"
|
||||
extracted="${extracted%.tbz2}"; extracted="${extracted%.tbz}"
|
||||
extracted="${extracted%.tar.gz}"; extracted="${extracted%.tgz}"
|
||||
extracted="${extracted%.tar.xz}"; extracted="${extracted%.txz}"
|
||||
extracted="${extracted%.zip}"
|
||||
case "$filename" in
|
||||
*.tar.bz2|*.tar.bz|*.tbz2|*.tbz)
|
||||
if tar jxvf "$filename" -C "$output_dir" 2>/dev/null; then
|
||||
log "Successfully extracted: $filename"
|
||||
rm -f "$filename"
|
||||
_sherpa_register_cleanup "$output_dir/$extracted"
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
@@ -113,6 +166,7 @@ download_and_extract() {
|
||||
if tar zxvf "$filename" -C "$output_dir" 2>/dev/null; then
|
||||
log "Successfully extracted: $filename"
|
||||
rm -f "$filename"
|
||||
_sherpa_register_cleanup "$output_dir/$extracted"
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
@@ -120,6 +174,7 @@ download_and_extract() {
|
||||
if tar Jxvf "$filename" -C "$output_dir" 2>/dev/null; then
|
||||
log "Successfully extracted: $filename"
|
||||
rm -f "$filename"
|
||||
_sherpa_register_cleanup "$output_dir/$extracted"
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
@@ -127,6 +182,7 @@ download_and_extract() {
|
||||
if unzip -q "$filename" -d "$output_dir" 2>/dev/null; then
|
||||
log "Successfully extracted: $filename"
|
||||
rm -f "$filename"
|
||||
_sherpa_register_cleanup "$output_dir/$extracted"
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
|
||||
+201
@@ -0,0 +1,201 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2026 Xiaomi Corp. (authors: Fangjun Kuang)
|
||||
#
|
||||
# Generate build matrix for test-flutter-asr.yaml.
|
||||
# Each job builds flutter-examples/streaming_asr with one streaming ASR model
|
||||
# selected (`final type = N;` in lib/streaming_asr.dart).
|
||||
|
||||
import json
|
||||
|
||||
# (model_index, model_dir_name, tarball filename, rule_fsts, post_cmd)
|
||||
#
|
||||
# model_dir_name is both the extracted directory in assets/ and the name that
|
||||
# goes into the released zip (flutter-streaming_asr-<model_dir_name>-<platform>.zip).
|
||||
# post_cmd runs inside assets/ after extraction (downloads the optional rule
|
||||
# fst and strips files the app does not need).
|
||||
STREAMING_ASR_MODELS = [
|
||||
(
|
||||
0,
|
||||
"sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20",
|
||||
"sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2",
|
||||
"itn_zh_number.fst",
|
||||
"""
|
||||
if [ ! -f itn_zh_number.fst ]; then
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/itn_zh_number.fst
|
||||
fi
|
||||
pushd sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20
|
||||
rm -fv encoder-epoch-99-avg-1.onnx
|
||||
rm -fv decoder-epoch-99-avg-1.int8.onnx
|
||||
rm -fv joiner-epoch-99-avg-1.int8.onnx
|
||||
rm -fv *.sh bpe.model README.md .gitattributes *state*
|
||||
rm -rfv test_wavs
|
||||
ls -lh
|
||||
popd
|
||||
""",
|
||||
),
|
||||
(
|
||||
1,
|
||||
"sherpa-onnx-streaming-zipformer-en-2023-06-26",
|
||||
"sherpa-onnx-streaming-zipformer-en-2023-06-26.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
pushd sherpa-onnx-streaming-zipformer-en-2023-06-26
|
||||
rm -fv encoder-epoch-99-avg-1-chunk-16-left-128.onnx
|
||||
rm -fv decoder-epoch-99-avg-1-chunk-16-left-128.int8.onnx
|
||||
rm -fv joiner-epoch-99-avg-1-chunk-16-left-128.int8.onnx
|
||||
rm -fv *.sh bpe.model README.md .gitattributes *state*
|
||||
rm -rfv test_wavs
|
||||
ls -lh
|
||||
popd
|
||||
""",
|
||||
),
|
||||
(
|
||||
2,
|
||||
"icefall-asr-zipformer-streaming-wenetspeech-20230615",
|
||||
"icefall-asr-zipformer-streaming-wenetspeech-20230615.tar.bz2",
|
||||
"itn_zh_number.fst",
|
||||
"""
|
||||
if [ ! -f itn_zh_number.fst ]; then
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/itn_zh_number.fst
|
||||
fi
|
||||
pushd icefall-asr-zipformer-streaming-wenetspeech-20230615
|
||||
rm -fv exp/encoder-epoch-12-avg-4-chunk-16-left-128.onnx
|
||||
rm -fv exp/decoder-epoch-12-avg-4-chunk-16-left-128.int8.onnx
|
||||
rm -fv exp/joiner-epoch-12-avg-4-chunk-16-left-128.int8.onnx
|
||||
rm -fv *.sh bpe.model README.md .gitattributes *state*
|
||||
rm -rfv test_wavs
|
||||
ls -lh
|
||||
popd
|
||||
""",
|
||||
),
|
||||
(
|
||||
3,
|
||||
"sherpa-onnx-streaming-zipformer-fr-2023-04-14",
|
||||
"sherpa-onnx-streaming-zipformer-fr-2023-04-14.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
pushd sherpa-onnx-streaming-zipformer-fr-2023-04-14
|
||||
rm -fv encoder-epoch-12-avg-5.onnx
|
||||
rm -fv decoder-epoch-12-avg-5.int8.onnx
|
||||
rm -fv joiner-epoch-12-avg-5.int8.onnx
|
||||
rm -fv *.sh bpe.model README.md .gitattributes *state*
|
||||
rm -rfv test_wavs
|
||||
ls -lh
|
||||
popd
|
||||
""",
|
||||
),
|
||||
(
|
||||
4,
|
||||
"sherpa-onnx-x-asr-960ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05",
|
||||
"sherpa-onnx-x-asr-960ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
pushd sherpa-onnx-x-asr-960ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05
|
||||
rm -fv encoder.onnx joiner.onnx decoder.int8.onnx
|
||||
rm -fv bpe.model test_onnx.py README.md .gitattributes *state*
|
||||
rm -rfv test_wavs
|
||||
ls -lh
|
||||
popd
|
||||
""",
|
||||
),
|
||||
(
|
||||
5,
|
||||
"sherpa-onnx-nemotron-3.5-asr-streaming-0.6b-560ms-int8-2026-06-11",
|
||||
"sherpa-onnx-nemotron-3.5-asr-streaming-0.6b-560ms-int8-2026-06-11.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
pushd sherpa-onnx-nemotron-3.5-asr-streaming-0.6b-560ms-int8-2026-06-11
|
||||
rm -fv encoder.onnx decoder.onnx joiner.onnx
|
||||
rm -fv *.py README.md .gitattributes *state*
|
||||
rm -rfv test_wavs
|
||||
ls -lh
|
||||
popd
|
||||
""",
|
||||
),
|
||||
(
|
||||
6,
|
||||
"sherpa-onnx-x-asr-480ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05",
|
||||
"sherpa-onnx-x-asr-480ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
pushd sherpa-onnx-x-asr-480ms-streaming-zipformer-transducer-zh-en-punct-int8-2026-06-05
|
||||
rm -fv encoder.onnx joiner.onnx decoder.int8.onnx
|
||||
rm -fv bpe.model test_onnx.py README.md .gitattributes *state*
|
||||
rm -rfv test_wavs
|
||||
ls -lh
|
||||
popd
|
||||
""",
|
||||
),
|
||||
(
|
||||
7,
|
||||
"sherpa-onnx-nemotron-3.5-asr-streaming-0.6b-1120ms-int8-2026-06-11",
|
||||
"sherpa-onnx-nemotron-3.5-asr-streaming-0.6b-1120ms-int8-2026-06-11.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
pushd sherpa-onnx-nemotron-3.5-asr-streaming-0.6b-1120ms-int8-2026-06-11
|
||||
rm -fv encoder.onnx decoder.onnx joiner.onnx
|
||||
rm -fv *.py README.md .gitattributes *state*
|
||||
rm -rfv test_wavs
|
||||
ls -lh
|
||||
popd
|
||||
""",
|
||||
),
|
||||
]
|
||||
|
||||
ANDROID_ABIS = [
|
||||
{
|
||||
"abi": "arm64-v8a",
|
||||
"target_platform": "android-arm64",
|
||||
"build_script": "build-android-arm64-v8a.sh",
|
||||
"build_dir": "build-android-arm64-v8a",
|
||||
"plugin": "sherpa_onnx_android_arm64",
|
||||
"plugin_key": "sherpa_onnx_android_arm64",
|
||||
},
|
||||
{
|
||||
"abi": "armeabi-v7a",
|
||||
"target_platform": "android-arm",
|
||||
"build_script": "build-android-armv7-eabi.sh",
|
||||
"build_dir": "build-android-armv7-eabi",
|
||||
"plugin": "sherpa_onnx_android_armeabi",
|
||||
"plugin_key": "sherpa_onnx_android_armeabi",
|
||||
},
|
||||
{
|
||||
"abi": "x86_64",
|
||||
"target_platform": "android-x64",
|
||||
"build_script": "build-android-x86-64.sh",
|
||||
"build_dir": "build-android-x86-64",
|
||||
"plugin": "sherpa_onnx_android_x86_64",
|
||||
"plugin_key": "sherpa_onnx_android_x86_64",
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
def make_entry(idx, name, tarball, rule_fsts, post_cmd):
|
||||
return {
|
||||
"demo": "streaming_asr",
|
||||
"asr_model_index": idx,
|
||||
"asr_model_name": name,
|
||||
"asr_tarball": tarball,
|
||||
"asr_rule_fsts": rule_fsts,
|
||||
"asr_post_cmd": post_cmd,
|
||||
}
|
||||
|
||||
|
||||
def main():
|
||||
desktop_entries = []
|
||||
android_entries = []
|
||||
for idx, name, tarball, rule_fsts, post_cmd in STREAMING_ASR_MODELS:
|
||||
desktop_entries.append(make_entry(idx, name, tarball, rule_fsts, post_cmd))
|
||||
for abi_cfg in ANDROID_ABIS:
|
||||
entry = make_entry(idx, name, tarball, rule_fsts, post_cmd)
|
||||
entry.update(abi_cfg)
|
||||
android_entries.append(entry)
|
||||
|
||||
print(json.dumps({
|
||||
"desktop": {"include": desktop_entries},
|
||||
"android": {"include": android_entries},
|
||||
}))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
+195
@@ -0,0 +1,195 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2026 Xiaomi Corp. (authors: Fangjun Kuang)
|
||||
#
|
||||
# Generate build matrix for test-flutter-tts.yaml.
|
||||
# Each job builds flutter-examples/tts with one TTS model selected
|
||||
# (selectedModelIndex in lib/model_config.dart).
|
||||
|
||||
import json
|
||||
|
||||
# (model_index, model_dir_name, tarball filename, extra_cmd, cleanup_cmd)
|
||||
#
|
||||
# model_dir_name is both the extracted directory in assets/ and the name that
|
||||
# goes into the released zip (flutter-tts-<model_dir_name>-<platform>.zip).
|
||||
# extra_cmd/cleanup_cmd run inside the model's assets/ staging directory.
|
||||
TTS_MODELS = [
|
||||
(
|
||||
0,
|
||||
"vits-piper-en_US-amy-low",
|
||||
"vits-piper-en_US-amy-low.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
rm -rf test_wavs espeak-ng-data
|
||||
rm -fv README.md LICENSE *.py
|
||||
ls -lh
|
||||
""",
|
||||
),
|
||||
(
|
||||
1,
|
||||
"vits-piper-zh_CN-xiao_ya-medium",
|
||||
"vits-piper-zh_CN-xiao_ya-medium.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
rm -rf test_wavs espeak-ng-data
|
||||
rm -fv README.md LICENSE *.py
|
||||
ls -lh
|
||||
""",
|
||||
),
|
||||
(
|
||||
2,
|
||||
"vits-piper-en_US-libritts_r-medium",
|
||||
"vits-piper-en_US-libritts_r-medium.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
rm -rf test_wavs espeak-ng-data
|
||||
rm -fv README.md LICENSE *.py
|
||||
ls -lh
|
||||
""",
|
||||
),
|
||||
(
|
||||
3,
|
||||
"vits-inflect-en-nano-v2",
|
||||
"vits-inflect-en-nano-v2.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
rm -rf test_wavs espeak-ng-data
|
||||
rm -fv README.md LICENSE *.py
|
||||
ls -lh
|
||||
""",
|
||||
),
|
||||
(
|
||||
4,
|
||||
"kokoro-int8-en-v0_19",
|
||||
"kokoro-int8-en-v0_19.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
rm -rf test_wavs espeak-ng-data
|
||||
rm -fv README.md LICENSE *.py
|
||||
ls -lh
|
||||
""",
|
||||
),
|
||||
(
|
||||
5,
|
||||
"kokoro-multi-lang-v1_0",
|
||||
"kokoro-multi-lang-v1_0.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
rm -rf test_wavs espeak-ng-data
|
||||
rm -fv README.md LICENSE *.py
|
||||
ls -lh
|
||||
""",
|
||||
),
|
||||
(
|
||||
6,
|
||||
"matcha-icefall-en_US-ljspeech",
|
||||
"matcha-icefall-en_US-ljspeech.tar.bz2",
|
||||
"curl -sSL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx",
|
||||
"""
|
||||
rm -rf test_wavs espeak-ng-data
|
||||
rm -fv README.md LICENSE *.py
|
||||
ls -lh
|
||||
""",
|
||||
),
|
||||
(
|
||||
7,
|
||||
"matcha-icefall-zh-en",
|
||||
"matcha-icefall-zh-en.tar.bz2",
|
||||
"curl -sSL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-16khz-univ.onnx",
|
||||
"""
|
||||
rm -rf test_wavs espeak-ng-data
|
||||
rm -fv README.md LICENSE *.py
|
||||
ls -lh
|
||||
""",
|
||||
),
|
||||
(
|
||||
8,
|
||||
"kitten-nano-en-v0_1-fp16",
|
||||
"kitten-nano-en-v0_1-fp16.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
rm -rf test_wavs espeak-ng-data
|
||||
rm -fv README.md LICENSE *.py
|
||||
ls -lh
|
||||
""",
|
||||
),
|
||||
(
|
||||
9,
|
||||
"sherpa-onnx-pocket-tts-int8-2026-01-26",
|
||||
"sherpa-onnx-pocket-tts-int8-2026-01-26.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
rm -rf test_wavs espeak-ng-data
|
||||
rm -fv README.md LICENSE *.py
|
||||
ls -lh
|
||||
""",
|
||||
),
|
||||
(
|
||||
10,
|
||||
"sherpa-onnx-supertonic-3-tts-int8-2026-05-11",
|
||||
"sherpa-onnx-supertonic-3-tts-int8-2026-05-11.tar.bz2",
|
||||
"",
|
||||
"""
|
||||
rm -rf test_wavs espeak-ng-data
|
||||
rm -fv README.md LICENSE *.py
|
||||
ls -lh
|
||||
""",
|
||||
),
|
||||
]
|
||||
|
||||
ANDROID_ABIS = [
|
||||
{
|
||||
"abi": "arm64-v8a",
|
||||
"target_platform": "android-arm64",
|
||||
"build_script": "build-android-arm64-v8a.sh",
|
||||
"build_dir": "build-android-arm64-v8a",
|
||||
"plugin": "sherpa_onnx_android_arm64",
|
||||
"plugin_key": "sherpa_onnx_android_arm64",
|
||||
},
|
||||
{
|
||||
"abi": "armeabi-v7a",
|
||||
"target_platform": "android-arm",
|
||||
"build_script": "build-android-armv7-eabi.sh",
|
||||
"build_dir": "build-android-armv7-eabi",
|
||||
"plugin": "sherpa_onnx_android_armeabi",
|
||||
"plugin_key": "sherpa_onnx_android_armeabi",
|
||||
},
|
||||
{
|
||||
"abi": "x86_64",
|
||||
"target_platform": "android-x64",
|
||||
"build_script": "build-android-x86-64.sh",
|
||||
"build_dir": "build-android-x86-64",
|
||||
"plugin": "sherpa_onnx_android_x86_64",
|
||||
"plugin_key": "sherpa_onnx_android_x86_64",
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
def make_entry(idx, name, tarball, extra_cmd, cleanup_cmd):
|
||||
return {
|
||||
"demo": "tts",
|
||||
"tts_model_index": idx,
|
||||
"tts_model_name": name,
|
||||
"tts_tarball": tarball,
|
||||
"tts_extra_cmd": extra_cmd,
|
||||
"tts_cleanup_cmd": cleanup_cmd,
|
||||
}
|
||||
|
||||
|
||||
def main():
|
||||
desktop_entries = []
|
||||
android_entries = []
|
||||
for idx, name, tarball, extra_cmd, cleanup_cmd in TTS_MODELS:
|
||||
desktop_entries.append(make_entry(idx, name, tarball, extra_cmd, cleanup_cmd))
|
||||
for abi_cfg in ANDROID_ABIS:
|
||||
entry = make_entry(idx, name, tarball, extra_cmd, cleanup_cmd)
|
||||
entry.update(abi_cfg)
|
||||
android_entries.append(entry)
|
||||
|
||||
print(json.dumps({
|
||||
"desktop": {"include": desktop_entries},
|
||||
"android": {"include": android_entries},
|
||||
}))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Regular → Executable
File mode changed.
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
cd go-api-examples/non-streaming-tts-phonemize
|
||||
go mod tidy
|
||||
|
||||
# On Windows, piper-phonemize's native DLLs live inside the
|
||||
# piper-phonemize-go-windows module (the module cache) and are not on the
|
||||
# loader's search path. Copy them next to the built binary so they can be
|
||||
# found at runtime. (Linux/macOS find the lib via the normal mechanisms.)
|
||||
if [[ "$OSTYPE" == msys* || "$OSTYPE" == cygwin* || "$OSTYPE" == win32 ]]; then
|
||||
case "$(go env GOARCH)" in
|
||||
amd64) triple=x86_64-pc-windows-gnu ;;
|
||||
386) triple=i686-pc-windows-gnu ;;
|
||||
arm64) triple=aarch64-pc-windows-gnu ;;
|
||||
esac
|
||||
pp_dir=$(go list -m -f '{{.Dir}}' github.com/csukuangfj/piper-phonemize-go-windows)
|
||||
cp -v "$pp_dir/lib/$triple"/*.dll .
|
||||
fi
|
||||
|
||||
go build
|
||||
./run-vits-piper-phonemize.sh
|
||||
./run-kitten-en-phonemize.sh
|
||||
./run-kokoro-en-phonemize.sh
|
||||
./run-matcha-en-phonemize.sh
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
cd go-api-examples/offline-zipformer-ctc-hlg
|
||||
go mod tidy
|
||||
go build
|
||||
./run.sh
|
||||
@@ -10,6 +10,48 @@ pushd version
|
||||
./run.sh
|
||||
popd
|
||||
|
||||
pushd tts
|
||||
|
||||
echo '----------tts----------'
|
||||
./run-pocket-en.sh
|
||||
./run-kitten-en-lexicon.sh
|
||||
./run-kitten-en-phonemize.sh
|
||||
./run-supertonic-en.sh
|
||||
./run-kokoro-zh-en-lexicon.sh
|
||||
./run-kokoro-en-lexicon.sh
|
||||
./run-kokoro-en-phonemize.sh
|
||||
./run-matcha-zh-lexicon.sh
|
||||
./run-matcha-en-lexicon.sh
|
||||
./run-matcha-en-phonemize.sh
|
||||
./run-zipvoice-zh-en-lexicon.sh
|
||||
ls -lh *.wav
|
||||
rm -rf matcha-icefall-*
|
||||
rm -rf sherpa-onnx-zipvoice-*
|
||||
rm -f lexicon-en-us.txt
|
||||
rm *.onnx
|
||||
|
||||
echo '----------piper tts----------'
|
||||
./run-piper-lexicon.sh
|
||||
./run-piper-phonemize.sh
|
||||
rm -f lexicon-en-us.txt
|
||||
rm -rf vits-piper-*
|
||||
|
||||
echo '----------german tts----------'
|
||||
./run-vits-de-phonemize.sh
|
||||
rm -rf vits-piper-*
|
||||
|
||||
echo '----------coqui tts----------'
|
||||
./run-coqui.sh
|
||||
rm -rf vits-coqui-*
|
||||
|
||||
echo '----------zh tts----------'
|
||||
./run-vits-zh-lexicon.sh
|
||||
rm -rf sherpa-onnx-*
|
||||
|
||||
ls -lh *.wav
|
||||
|
||||
popd # tts
|
||||
|
||||
pushd non-streaming-asr
|
||||
|
||||
echo '----------Moonshine v2----------'
|
||||
@@ -24,6 +66,10 @@ echo '----------Zipformer CTC----------'
|
||||
./run-zipformer-ctc.sh
|
||||
rm -rf sherpa-onnx-*
|
||||
|
||||
echo '----------Zipformer CTC HLG----------'
|
||||
./run-zipformer-ctc-hlg.sh
|
||||
rm -rf sherpa-onnx-*
|
||||
|
||||
echo '----------Cohere Transcribe----------'
|
||||
./run-cohere-transcribe.sh
|
||||
rm -rf sherpa-onnx-*
|
||||
@@ -122,38 +168,6 @@ echo "streaming speech enhancement with dpdfnet models"
|
||||
ls -lh
|
||||
popd
|
||||
|
||||
pushd tts
|
||||
|
||||
echo '----------tts----------'
|
||||
./run-pocket-en.sh
|
||||
./run-kitten-en.sh
|
||||
./run-supertonic-en.sh
|
||||
./run-kokoro-zh-en.sh
|
||||
./run-kokoro-en.sh
|
||||
./run-matcha-zh.sh
|
||||
./run-matcha-en.sh
|
||||
./run-zipvoice-zh-en.sh
|
||||
ls -lh *.wav
|
||||
rm -rf matcha-icefall-*
|
||||
rm -rf sherpa-onnx-zipvoice-*
|
||||
rm *.onnx
|
||||
|
||||
echo '----------piper tts----------'
|
||||
./run-piper.sh
|
||||
rm -rf vits-piper-*
|
||||
|
||||
echo '----------coqui tts----------'
|
||||
./run-coqui.sh
|
||||
rm -rf vits-coqui-*
|
||||
|
||||
echo '----------zh tts----------'
|
||||
./run-vits-zh.sh
|
||||
rm -rf sherpa-onnx-*
|
||||
|
||||
ls -lh *.wav
|
||||
|
||||
popd # tts
|
||||
|
||||
pushd spoken-language-identification
|
||||
./run-whisper.sh
|
||||
popd
|
||||
|
||||
@@ -5,14 +5,88 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/common.sh"
|
||||
cd dotnet-examples/
|
||||
|
||||
cd ./non-streaming-cohere-transcribe-decode-files
|
||||
cd ./version-test
|
||||
./run.sh
|
||||
ls -lh
|
||||
|
||||
|
||||
cd ../kitten-tts-lexicon
|
||||
./run-kitten-lexicon.sh
|
||||
ls -lh
|
||||
rm -rf kitten-nano-en-v0_1-fp16
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
cd ../kitten-tts-phonemize
|
||||
./run-kitten-phonemize.sh
|
||||
ls -lh
|
||||
rm -rf kitten-nano-en-v0_1-fp16
|
||||
|
||||
cd ../kokoro-tts-lexicon
|
||||
./run-kokoro-lexicon.sh
|
||||
ls -lh
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
cd ../kokoro-tts-phonemize
|
||||
./run-kokoro-phonemize.sh
|
||||
ls -lh
|
||||
|
||||
cd ../offline-tts-lexicon
|
||||
./run-matcha-zh-lexicon.sh
|
||||
ls -lh *.wav
|
||||
./run-matcha-en-lexicon.sh
|
||||
ls -lh *.wav
|
||||
./run-aishell3-lexicon.sh
|
||||
ls -lh *.wav
|
||||
./run-piper-lexicon.sh
|
||||
ls -lh *.wav
|
||||
./run-hf-fanchen-lexicon.sh
|
||||
ls -lh *.wav
|
||||
ls -lh
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
cd ../offline-tts-phonemize
|
||||
./run-piper-phonemize.sh
|
||||
ls -lh *.wav
|
||||
./run-matcha-en-phonemize.sh
|
||||
ls -lh *.wav
|
||||
ls -lh
|
||||
|
||||
cd ../pocket-tts-zero-shot
|
||||
./run.sh
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-pocket-*
|
||||
|
||||
cd ../supertonic-tts
|
||||
./run.sh
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-supertonic-*
|
||||
|
||||
cd ../zipvoice-tts-lexicon
|
||||
./run-lexicon.sh
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-zipvoice-*
|
||||
rm -f vocos_24khz.onnx lexicon-en-us.txt
|
||||
|
||||
pushd ../..
|
||||
|
||||
mkdir tts
|
||||
|
||||
cp -v dotnet-examples/kokoro-tts-lexicon/*.wav ./tts
|
||||
cp -v dotnet-examples/kokoro-tts-phonemize/*.wav ./tts
|
||||
cp -v dotnet-examples/kitten-tts-lexicon/*.wav ./tts
|
||||
cp -v dotnet-examples/kitten-tts-phonemize/*.wav ./tts
|
||||
cp -v dotnet-examples/offline-tts-lexicon/*.wav ./tts
|
||||
cp -v dotnet-examples/offline-tts-phonemize/*.wav ./tts
|
||||
cp -v dotnet-examples/supertonic-tts/*.wav ./tts
|
||||
cp -v dotnet-examples/zipvoice-tts-lexicon/*.wav ./tts
|
||||
popd
|
||||
|
||||
cd ../non-streaming-cohere-transcribe-decode-files
|
||||
./run.sh
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-cohere-transcribe-*
|
||||
|
||||
cd ..
|
||||
|
||||
cd ./vad-non-streaming-qwen3-asr
|
||||
cd ../vad-non-streaming-qwen3-asr
|
||||
./run-ten-vad.sh
|
||||
rm -fv *.onnx
|
||||
|
||||
@@ -36,11 +110,6 @@ cd ../source-separation-uvr
|
||||
ls -lh
|
||||
rm -f UVR-MDX-NET-Voc_FT.onnx
|
||||
|
||||
cd ../supertonic-tts
|
||||
./run.sh
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-supertonic-*
|
||||
|
||||
cd ../non-streaming-moonshine-v2-decode-files
|
||||
./run.sh
|
||||
rm -rf sherpa-onnx-moonshine-*
|
||||
@@ -101,17 +170,6 @@ rm -rf sherpa-onnx-*
|
||||
./run-tdnn-yesno.sh
|
||||
rm -rf sherpa-onnx-*
|
||||
|
||||
cd ../pocket-tts-zero-shot
|
||||
./run.sh
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-pocket-*
|
||||
|
||||
cd ../zipvoice-tts
|
||||
./run.sh
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-zipvoice-*
|
||||
rm -f vocos_24khz.onnx
|
||||
|
||||
cd ../vad-non-streaming-funasr-nano
|
||||
./run-ten-vad.sh
|
||||
rm -fv *.onnx
|
||||
@@ -124,20 +182,12 @@ cd ../non-streaming-funasr-nano-decode-files
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-funasr-*
|
||||
|
||||
cd ../version-test
|
||||
./run.sh
|
||||
ls -lh
|
||||
|
||||
cd ../offline-audio-tagging
|
||||
./run.sh
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-*
|
||||
|
||||
cd ../kitten-tts
|
||||
./run-kitten.sh
|
||||
ls -lh
|
||||
rm -rf kitten-nano-en-v0_1-fp16
|
||||
|
||||
cd ../vad-non-streaming-asr-paraformer
|
||||
./run-ten-vad.sh
|
||||
rm -fv *.onnx
|
||||
@@ -151,8 +201,6 @@ cd ../non-streaming-canary-decode-files
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-nemo-*
|
||||
|
||||
|
||||
|
||||
cd ../speech-enhancement-gtcrn
|
||||
./run.sh
|
||||
ls -lh
|
||||
@@ -169,33 +217,6 @@ cd ../streaming-speech-enhancement-dpdfnet
|
||||
./run.sh
|
||||
ls -lh
|
||||
|
||||
cd ../kokoro-tts
|
||||
./run-kokoro.sh
|
||||
ls -lh
|
||||
|
||||
cd ../offline-tts
|
||||
./run-matcha-zh.sh
|
||||
ls -lh *.wav
|
||||
./run-matcha-en.sh
|
||||
ls -lh *.wav
|
||||
./run-aishell3.sh
|
||||
ls -lh *.wav
|
||||
./run-piper.sh
|
||||
ls -lh *.wav
|
||||
./run-hf-fanchen.sh
|
||||
ls -lh *.wav
|
||||
ls -lh
|
||||
|
||||
pushd ../..
|
||||
|
||||
mkdir tts
|
||||
|
||||
cp -v dotnet-examples/kokoro-tts/*.wav ./tts
|
||||
cp -v dotnet-examples/offline-tts/*.wav ./tts
|
||||
cp -v dotnet-examples/supertonic-tts/*.wav ./tts
|
||||
cp -v dotnet-examples/zipvoice-tts/*.wav ./tts
|
||||
popd
|
||||
|
||||
cd ../offline-speaker-diarization
|
||||
./run.sh
|
||||
rm -rfv *.onnx
|
||||
@@ -236,6 +257,10 @@ cd ../streaming-hlg-decoding/
|
||||
./run.sh
|
||||
rm -rf sherpa-onnx-*
|
||||
|
||||
cd ../offline-zipformer-ctc-hlg/
|
||||
./run.sh
|
||||
rm -rf sherpa-onnx-*
|
||||
|
||||
cd ../spoken-language-identification
|
||||
./run.sh
|
||||
rm -rf sherpa-onnx-*
|
||||
@@ -11,6 +11,128 @@ arch=$(node -p "require('os').arch()")
|
||||
platform=$(node -p "require('os').platform()")
|
||||
node_version=$(node -p "process.versions.node.split('.')[0]")
|
||||
|
||||
echo "----------Version----------"
|
||||
node ./test_version.js
|
||||
|
||||
echo "----------PocketTTS----------"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-pocket-tts-int8-2026-01-26.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_pocket_en.js
|
||||
node ./test_tts_non_streaming_pocket_en_async.js
|
||||
|
||||
rm -rf sherpa-onnx-pocket-tts-int8-2026-01-26
|
||||
|
||||
echo "----------ZipVoice----------"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-zipvoice-distill-int8-zh-en-emilia.tar.bz2
|
||||
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos_24khz.onnx
|
||||
|
||||
node ./test_tts_non_streaming_zipvoice_zh_en_lexicon.js
|
||||
node ./test_tts_non_streaming_zipvoice_zh_en_lexicon_async.js
|
||||
|
||||
rm -rf sherpa-onnx-zipvoice-distill-int8-zh-en-emilia
|
||||
rm -f vocos_24khz.onnx
|
||||
|
||||
echo "----------KittenTTS----------"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kitten-nano-en-v0_1-fp16.tar.bz2
|
||||
|
||||
# shared English lexicon for the lexicon-based examples
|
||||
if [ ! -f ./lexicon-en-us.txt ]; then
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
fi
|
||||
|
||||
node ./test_tts_non_streaming_kitten_en_lexicon.js
|
||||
node ./test_tts_non_streaming_kitten_en_lexicon_sync.js
|
||||
node ./test_tts_non_streaming_kitten_en_phonemize.js
|
||||
node ./test_tts_non_streaming_kitten_en_phonemize_sync.js
|
||||
|
||||
rm -rf kitten-nano-en-v0_1-fp16
|
||||
|
||||
echo "----------SupertonicTTS----------"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-supertonic-3-tts-int8-2026-05-11.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_supertonic_en.js
|
||||
node ./test_tts_non_streaming_supertonic_en_async.js
|
||||
|
||||
rm -rf sherpa-onnx-supertonic-3-tts-int8-2026-05-11
|
||||
|
||||
echo "----------tts----------"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-multi-lang-v1_0.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_kokoro_zh_en_lexicon.js
|
||||
node ./test_tts_non_streaming_kokoro_zh_en_lexicon_async.js
|
||||
ls -lh *.wav
|
||||
rm -rf kokoro-multi-lang-v1_0
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-en-v0_19.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_kokoro_en_lexicon.js
|
||||
node ./test_tts_non_streaming_kokoro_en_lexicon_async.js
|
||||
node ./test_tts_non_streaming_kokoro_en_phonemize.js
|
||||
node ./test_tts_non_streaming_kokoro_en_phonemize_async.js
|
||||
ls -lh *.wav
|
||||
rm -rf kokoro-en-v0_19
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-en_US-ljspeech.tar.bz2
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
|
||||
node ./test_tts_non_streaming_matcha_icefall_en_lexicon.js
|
||||
node ./test_tts_non_streaming_matcha_icefall_en_lexicon_async.js
|
||||
node ./test_tts_non_streaming_matcha_icefall_en_phonemize.js
|
||||
node ./test_tts_non_streaming_matcha_icefall_en_phonemize_async.js
|
||||
rm vocos-22khz-univ.onnx
|
||||
rm -rf matcha-icefall-en_US-ljspeech
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-baker.tar.bz2
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
|
||||
node ./test_tts_non_streaming_matcha_icefall_zh_lexicon.js
|
||||
node ./test_tts_non_streaming_matcha_icefall_zh_lexicon_async.js
|
||||
rm vocos-22khz-univ.onnx
|
||||
rm -rf matcha-icefall-zh-baker
|
||||
ls -lh *.wav
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_GB-cori-medium.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_vits_piper_en_lexicon.js
|
||||
node ./test_tts_non_streaming_vits_piper_en_lexicon_async.js
|
||||
node ./test_tts_async_callback_stress_lexicon.js ./vits-piper-en_GB-cori-medium 30
|
||||
node ./test_tts_non_streaming_vits_piper_en_phonemize.js
|
||||
node ./test_tts_non_streaming_vits_piper_en_phonemize_async.js
|
||||
node ./test_tts_async_callback_stress_phonemize.js ./vits-piper-en_GB-cori-medium 30
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-de_DE-glados-low.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_vits_piper_de_phonemize.js
|
||||
node ./test_tts_non_streaming_vits_piper_de_phonemize_async.js
|
||||
|
||||
rm -rf vits-piper-de_DE-glados-low
|
||||
rm -f lexicon-en-us.txt
|
||||
rm -rf vits-piper-en_GB-cori-medium
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-coqui-de-css10.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_vits_coqui_de.js
|
||||
node ./test_tts_non_streaming_vits_coqui_de_async.js
|
||||
rm -rf vits-coqui-de-css10
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-vits-zh-ll.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_vits_zh_ll_lexicon.js
|
||||
node ./test_tts_non_streaming_vits_zh_ll_lexicon_async.js
|
||||
rm -rf sherpa-onnx-vits-zh-ll
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-icefall-zh-aishell3.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_vits_zh_aishell3_lexicon.js
|
||||
node ./test_tts_non_streaming_vits_zh_aishell3_lexicon_async.js
|
||||
rm -rf vits-icefall-zh-aishell3
|
||||
|
||||
echo "----------Cohere Transcribe----------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-cohere-transcribe-14-lang-int8-2026-04-01.tar.bz2
|
||||
|
||||
@@ -42,26 +164,6 @@ node ./test_asr_non_streaming_fire_red_asr_ctc_async.js
|
||||
|
||||
rm -rf sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25
|
||||
|
||||
echo "----------PocketTTS----------"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-pocket-tts-int8-2026-01-26.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_pocket_en.js
|
||||
node ./test_tts_non_streaming_pocket_en_async.js
|
||||
|
||||
rm -rf sherpa-onnx-pocket-tts-int8-2026-01-26
|
||||
|
||||
echo "----------ZipVoice----------"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-zipvoice-distill-int8-zh-en-emilia.tar.bz2
|
||||
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos_24khz.onnx
|
||||
|
||||
node ./test_tts_non_streaming_zipvoice_zh_en.js
|
||||
node ./test_tts_non_streaming_zipvoice_zh_en_async.js
|
||||
|
||||
rm -rf sherpa-onnx-zipvoice-distill-int8-zh-en-emilia
|
||||
rm -f vocos_24khz.onnx
|
||||
|
||||
echo "----------non-streaming ASR FunASR Nano----------"
|
||||
|
||||
@@ -102,23 +204,6 @@ node ./test_asr_streaming_t_one_ctc.js
|
||||
|
||||
rm -rf sherpa-onnx-streaming-t-one-russian-2025-09-08
|
||||
|
||||
echo "----------KittenTTS----------"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kitten-nano-en-v0_1-fp16.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_kitten_en.js
|
||||
node ./test_tts_non_streaming_kitten_en_sync.js
|
||||
|
||||
rm -rf kitten-nano-en-v0_1-fp16
|
||||
|
||||
echo "----------SupertonicTTS----------"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-supertonic-3-tts-int8-2026-05-11.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_supertonic_en.js
|
||||
node ./test_tts_non_streaming_supertonic_en_async.js
|
||||
|
||||
rm -rf sherpa-onnx-supertonic-3-tts-int8-2026-05-11
|
||||
|
||||
echo "----------non-streaming ASR NeMo Canary----------"
|
||||
|
||||
@@ -134,6 +219,12 @@ download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/asr
|
||||
node ./test_asr_non_streaming_zipformer_ctc.js
|
||||
rm -rf sherpa-onnx-zipformer-ctc-zh-int8-2025-07-03
|
||||
|
||||
echo "----------non-streaming ASR Zipformer CTC HLG----------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-zipformer-ctc-en-2023-10-02.tar.bz2
|
||||
|
||||
node ./test_asr_non_streaming_zipformer_ctc_hlg.js
|
||||
rm -rf sherpa-onnx-zipformer-ctc-en-2023-10-02
|
||||
|
||||
echo "----------non-streaming ASR NeMo parakeet tdt----------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8.tar.bz2
|
||||
|
||||
@@ -244,63 +335,6 @@ if [[ $arch != "ia32" && $platform != "win32" ]]; then
|
||||
rm -rf sherpa-onnx-paraformer-zh-2023-09-14
|
||||
fi
|
||||
|
||||
echo "----------tts----------"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-multi-lang-v1_0.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_kokoro_zh_en.js
|
||||
node ./test_tts_non_streaming_kokoro_zh_en_async.js
|
||||
ls -lh *.wav
|
||||
rm -rf kokoro-multi-lang-v1_0
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-en-v0_19.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_kokoro_en.js
|
||||
node ./test_tts_non_streaming_kokoro_en_async.js
|
||||
ls -lh *.wav
|
||||
rm -rf kokoro-en-v0_19
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-en_US-ljspeech.tar.bz2
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
|
||||
node ./test_tts_non_streaming_matcha_icefall_en.js
|
||||
node ./test_tts_non_streaming_matcha_icefall_en_async.js
|
||||
rm vocos-22khz-univ.onnx
|
||||
rm -rf matcha-icefall-en_US-ljspeech
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-baker.tar.bz2
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
|
||||
node ./test_tts_non_streaming_matcha_icefall_zh.js
|
||||
node ./test_tts_non_streaming_matcha_icefall_zh_async.js
|
||||
rm vocos-22khz-univ.onnx
|
||||
rm -rf matcha-icefall-zh-baker
|
||||
ls -lh *.wav
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_GB-cori-medium.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_vits_piper_en.js
|
||||
node ./test_tts_non_streaming_vits_piper_en_async.js
|
||||
node ./test_tts_async_callback_stress.js ./vits-piper-en_GB-cori-medium 30
|
||||
rm -rf vits-piper-en_GB-cori-medium
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-coqui-de-css10.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_vits_coqui_de.js
|
||||
node ./test_tts_non_streaming_vits_coqui_de_async.js
|
||||
rm -rf vits-coqui-de-css10
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-vits-zh-ll.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_vits_zh_ll.js
|
||||
node ./test_tts_non_streaming_vits_zh_ll_async.js
|
||||
rm -rf sherpa-onnx-vits-zh-ll
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-icefall-zh-aishell3.tar.bz2
|
||||
|
||||
node ./test_tts_non_streaming_vits_zh_aishell3.js
|
||||
node ./test_tts_non_streaming_vits_zh_aishell3_async.js
|
||||
rm -rf vits-icefall-zh-aishell3
|
||||
|
||||
echo "----------keyword spotting----------"
|
||||
|
||||
|
||||
@@ -13,6 +13,95 @@ ls -lh node_modules
|
||||
echo "---test version---"
|
||||
node ./test-version.js
|
||||
|
||||
# tts
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kitten-nano-en-v0_1-fp16.tar.bz2
|
||||
|
||||
# shared English lexicon for the lexicon-based examples
|
||||
if [ ! -f ./lexicon-en-us.txt ]; then
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
fi
|
||||
|
||||
node ./test-offline-tts-kitten-en-lexicon.js
|
||||
node ./test-offline-tts-kitten-en-phonemize.js
|
||||
ls -lh *.wav
|
||||
rm -rf kitten-nano-en-v0_1-fp16
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-supertonic-3-tts-int8-2026-05-11.tar.bz2
|
||||
|
||||
node ./test-offline-tts-supertonic.js
|
||||
ls -lh *.wav
|
||||
rm -rf sherpa-onnx-supertonic-3-tts-int8-2026-05-11
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-zipvoice-distill-int8-zh-en-emilia.tar.bz2
|
||||
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos_24khz.onnx
|
||||
|
||||
node ./test-offline-tts-zipvoice-zh-en-lexicon.js
|
||||
ls -lh *.wav
|
||||
rm -rf sherpa-onnx-zipvoice-distill-int8-zh-en-emilia
|
||||
rm -f vocos_24khz.onnx
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-multi-lang-v1_0.tar.bz2
|
||||
|
||||
node ./test-offline-tts-kokoro-zh-en-lexicon.js
|
||||
ls -lh *.wav
|
||||
rm -rf kokoro-multi-lang-v1_0
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-en-v0_19.tar.bz2
|
||||
|
||||
node ./test-offline-tts-kokoro-en-lexicon.js
|
||||
node ./test-offline-tts-kokoro-en-phonemize.js
|
||||
rm -rf kokoro-en-v0_19
|
||||
|
||||
ls -lh
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-baker.tar.bz2
|
||||
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
|
||||
node ./test-offline-tts-matcha-zh-lexicon.js
|
||||
|
||||
rm -rf matcha-icefall-zh-baker
|
||||
rm vocos-22khz-univ.onnx
|
||||
|
||||
|
||||
echo "---"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-en_US-ljspeech.tar.bz2
|
||||
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
|
||||
node ./test-offline-tts-matcha-en-lexicon.js
|
||||
node ./test-offline-tts-matcha-en-phonemize.js
|
||||
|
||||
rm -rf matcha-icefall-en_US-ljspeech
|
||||
rm vocos-22khz-univ.onnx
|
||||
|
||||
echo "---"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-amy-low.tar.bz2
|
||||
node ./test-offline-tts-vits-en-lexicon.js
|
||||
node ./test-offline-tts-vits-en-phonemize.js
|
||||
rm -rf vits-piper-en_US-amy-low*
|
||||
|
||||
echo "---"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-de_DE-glados-low.tar.bz2
|
||||
node ./test-offline-tts-vits-de-phonemize.js
|
||||
rm -rf vits-piper-de_DE-glados-low*
|
||||
|
||||
echo "---"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-icefall-zh-aishell3.tar.bz2
|
||||
node ./test-offline-tts-vits-zh-lexicon.js
|
||||
rm -rf vits-icefall-zh-aishell3*
|
||||
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
ls -lh *.wav
|
||||
|
||||
|
||||
if false; then
|
||||
# disable it for now since it fails, possible due to not using a recent version of onnxruntime
|
||||
echo "---test Qwen3 ASR---"
|
||||
@@ -83,18 +172,6 @@ node ./test-online-t-one-ctc.js
|
||||
|
||||
rm -rf sherpa-onnx-streaming-t-one-russian-2025-09-08
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kitten-nano-en-v0_1-fp16.tar.bz2
|
||||
|
||||
node ./test-offline-tts-kitten-en.js
|
||||
ls -lh *.wav
|
||||
rm -rf kitten-nano-en-v0_1-fp16
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-supertonic-3-tts-int8-2026-05-11.tar.bz2
|
||||
|
||||
node ./test-offline-tts-supertonic.js
|
||||
ls -lh *.wav
|
||||
rm -rf sherpa-onnx-supertonic-3-tts-int8-2026-05-11
|
||||
|
||||
# online asr
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-paraformer-bilingual-zh-en.tar.bz2
|
||||
node ./test-online-paraformer.js
|
||||
@@ -140,6 +217,12 @@ download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/asr
|
||||
node ./test-offline-zipformer-ctc.js
|
||||
rm -rf sherpa-onnx-zipformer-ctc-zh-int8-2025-07-03
|
||||
|
||||
# asr with offline zipformer ctc + HLG graph via ctcFstDecoderConfig
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-zipformer-ctc-en-2023-10-02.tar.bz2
|
||||
|
||||
node ./test-offline-zipformer-ctc-hlg.js
|
||||
rm -rf sherpa-onnx-zipformer-ctc-en-2023-10-02
|
||||
|
||||
# asr with offline dolphin ctc
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-dolphin-base-ctc-multi-lang-int8-2025-04-02.tar.bz2
|
||||
node ./test-offline-dolphin-ctc.js
|
||||
@@ -159,65 +242,6 @@ rm dpdfnet_baseline.onnx
|
||||
rm -fv inp_16k.wav
|
||||
rm -fv enhanced*.wav
|
||||
|
||||
# offline tts
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-zipvoice-distill-int8-zh-en-emilia.tar.bz2
|
||||
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos_24khz.onnx
|
||||
|
||||
node ./test-offline-tts-zipvoice-zh-en.js
|
||||
ls -lh *.wav
|
||||
rm -rf sherpa-onnx-zipvoice-distill-int8-zh-en-emilia
|
||||
rm -f vocos_24khz.onnx
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-multi-lang-v1_0.tar.bz2
|
||||
|
||||
node ./test-offline-tts-kokoro-zh-en.js
|
||||
ls -lh *.wav
|
||||
rm -rf kokoro-multi-lang-v1_0
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-en-v0_19.tar.bz2
|
||||
|
||||
node ./test-offline-tts-kokoro-en.js
|
||||
rm -rf kokoro-en-v0_19
|
||||
|
||||
ls -lh
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-baker.tar.bz2
|
||||
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
|
||||
node ./test-offline-tts-matcha-zh.js
|
||||
|
||||
rm -rf matcha-icefall-zh-baker
|
||||
rm vocos-22khz-univ.onnx
|
||||
|
||||
|
||||
echo "---"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-en_US-ljspeech.tar.bz2
|
||||
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
|
||||
node ./test-offline-tts-matcha-en.js
|
||||
|
||||
rm -rf matcha-icefall-en_US-ljspeech
|
||||
rm vocos-22khz-univ.onnx
|
||||
|
||||
echo "---"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-amy-low.tar.bz2
|
||||
node ./test-offline-tts-vits-en.js
|
||||
rm -rf vits-piper-en_US-amy-low*
|
||||
|
||||
echo "---"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-icefall-zh-aishell3.tar.bz2
|
||||
node ./test-offline-tts-vits-zh.js
|
||||
rm -rf vits-icefall-zh-aishell3*
|
||||
|
||||
ls -lh *.wav
|
||||
|
||||
echo '-----speaker diarization----------'
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-segmentation-models/sherpa-onnx-pyannote-segmentation-3-0.tar.bz2
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ log "------------------------------------------------------------"
|
||||
log "kokoro-en-v0_19"
|
||||
log "------------------------------------------------------------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-en-v0_19.tar.bz2
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
# mapping of sid to voice name
|
||||
# 0->af, 1->af_bella, 2->af_nicole, 3->af_sarah, 4->af_sky, 5->am_adam
|
||||
@@ -56,33 +57,40 @@ for sid in $(seq 0 10); do
|
||||
--kokoro-model=./kokoro-en-v0_19/model.onnx \
|
||||
--kokoro-voices=./kokoro-en-v0_19/voices.bin \
|
||||
--kokoro-tokens=./kokoro-en-v0_19/tokens.txt \
|
||||
--kokoro-data-dir=./kokoro-en-v0_19/espeak-ng-data \
|
||||
--kokoro-lexicon=./lexicon-en-us.txt \
|
||||
--num-threads=2 \
|
||||
--sid=$sid \
|
||||
--output-filename="./tts/kokoro-$sid.wav" \
|
||||
"Today as always, men fall into two groups: slaves and free men. Whoever does not have two-thirds of his day for himself, is a slave, whatever he may be a statesman, a businessman, an official, or a scholar."
|
||||
done
|
||||
rm -rf kokoro-en-v0_19
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "matcha-tts-fa_en-musa"
|
||||
log "------------------------------------------------------------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-tts-fa_en-musa.tar.bz2
|
||||
# Disabled: matcha-tts-fa_en-musa ships only espeak-ng-data, no lexicon.txt.
|
||||
# espeak-ng support was removed in v2.0.0, so --matcha-data-dir is now ignored
|
||||
# and this model has no usable text frontend. Re-enable it once a Persian
|
||||
# lexicon is published, or once the CLI can accept phoneme_codepoints.
|
||||
#
|
||||
# log "------------------------------------------------------------"
|
||||
# log "matcha-tts-fa_en-musa"
|
||||
# log "------------------------------------------------------------"
|
||||
# download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-tts-fa_en-musa.tar.bz2
|
||||
#
|
||||
# download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
#
|
||||
#
|
||||
# $EXE \
|
||||
# --matcha-acoustic-model=./matcha-tts-fa_en-musa/model.onnx \
|
||||
# --matcha-vocoder=./vocos-22khz-univ.onnx \
|
||||
# --matcha-tokens=./matcha-tts-fa_en-musa/tokens.txt \
|
||||
# --matcha-data-dir=./matcha-tts-fa_en-musa/espeak-ng-data \
|
||||
# --output-filename=./tts/test-matcha-fa-en-musa.wav \
|
||||
# --num-threads=2 \
|
||||
# "How are you doing today? این یک نمونه ی تست فارسی است. This is a test."
|
||||
#
|
||||
# rm -rf matcha-tts-fa_en-musa
|
||||
# rm vocos-22khz-univ.onnx
|
||||
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
|
||||
|
||||
$EXE \
|
||||
--matcha-acoustic-model=./matcha-tts-fa_en-musa/model.onnx \
|
||||
--matcha-vocoder=./vocos-22khz-univ.onnx \
|
||||
--matcha-tokens=./matcha-tts-fa_en-musa/tokens.txt \
|
||||
--matcha-data-dir=./matcha-tts-fa_en-musa/espeak-ng-data \
|
||||
--output-filename=./tts/test-matcha-fa-en-musa.wav \
|
||||
--num-threads=2 \
|
||||
"How are you doing today? این یک نمونه ی تست فارسی است. This is a test."
|
||||
|
||||
rm -rf matcha-tts-fa_en-musa
|
||||
rm vocos-22khz-univ.onnx
|
||||
ls -lh tts/*.wav
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
@@ -91,13 +99,14 @@ log "------------------------------------------------------------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-en_US-ljspeech.tar.bz2
|
||||
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
|
||||
$EXE \
|
||||
--matcha-acoustic-model=./matcha-icefall-en_US-ljspeech/model-steps-3.onnx \
|
||||
--matcha-vocoder=./vocos-22khz-univ.onnx \
|
||||
--matcha-tokens=./matcha-icefall-en_US-ljspeech/tokens.txt \
|
||||
--matcha-data-dir=./matcha-icefall-en_US-ljspeech/espeak-ng-data \
|
||||
--matcha-lexicon=./lexicon-en-us.txt \
|
||||
--num-threads=2 \
|
||||
--output-filename=./tts/matcha-ljspeech-1.wav \
|
||||
--debug=1 \
|
||||
@@ -105,6 +114,7 @@ $EXE \
|
||||
|
||||
rm vocos-22khz-univ.onnx
|
||||
rm -rf matcha-icefall-en_US-ljspeech
|
||||
rm -f lexicon-en-us.txt
|
||||
ls -lh tts/*.wav
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
@@ -141,17 +151,19 @@ log "------------------------------------------------------------"
|
||||
log "vits-piper-en_US-amy-low"
|
||||
log "------------------------------------------------------------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-amy-low.tar.bz2
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
$EXE \
|
||||
--vits-model=./vits-piper-en_US-amy-low/en_US-amy-low.onnx \
|
||||
--vits-tokens=./vits-piper-en_US-amy-low/tokens.txt \
|
||||
--vits-data-dir=./vits-piper-en_US-amy-low/espeak-ng-data \
|
||||
--vits-lexicon=./lexicon-en-us.txt \
|
||||
--debug=1 \
|
||||
--output-filename=./tts/amy.wav \
|
||||
"“Today as always, men fall into two groups: slaves and free men. Whoever does not have two-thirds of his day for himself, is a slave, whatever he may be: a statesman, a businessman, an official, or a scholar.” The sun shone bleakly in the sky, its meager light struggling to penetrate the thick foliage of the forest. Birds sang their songs up in the crowns of the trees, fluttering from one branch to the other. A blanket of total tranquility lied over the forest. The peace was only broken by the steady gallop of the horses of the soldiers who were traveling to their upcoming knighting the morrow at Camelot, and rowdy conversation. “Finally we will get what we deserve,” “It’s been about time,” Perceval agreed. “We’ve been risking our arses for the past two years. It’s the least they could give us.” Merlin remained ostensibly silent, refusing to join the verbal parade of self-aggrandizing his fellow soldiers have engaged in. He found it difficult to happy about anything, when even if they had won the war, he had lost everything else in the process."
|
||||
|
||||
file ./tts/amy.wav
|
||||
rm -rf vits-piper-en_US-amy-low
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "vits-ljs test"
|
||||
|
||||
@@ -21,351 +21,20 @@ log "Run NeMo transducer (English)"
|
||||
log "------------------------------------------------------------"
|
||||
repo_url=https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-nemo-streaming-fast-conformer-transducer-en-80ms.tar.bz2
|
||||
download_and_extract $repo_url
|
||||
|
||||
log "Start testing ${repo_url}"
|
||||
|
||||
repo=sherpa-onnx-nemo-streaming-fast-conformer-transducer-en-80ms
|
||||
|
||||
log "Start testing ${repo_url}"
|
||||
|
||||
waves=(
|
||||
$repo/test_wavs/0.wav
|
||||
$repo/test_wavs/1.wav
|
||||
$repo/test_wavs/8k.wav
|
||||
)
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder.onnx \
|
||||
--decoder=$repo/decoder.onnx \
|
||||
--joiner=$repo/joiner.onnx \
|
||||
--num-threads=2 \
|
||||
$wave
|
||||
done
|
||||
|
||||
# decode-file-c-api hard-codes these model paths and ignores any command-line
|
||||
# arguments (its main() takes none). The generic sherpa-onnx CLI needs them.
|
||||
# Passing the paths works for both: the CLI uses them, the C example ignores
|
||||
# them.
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder.onnx \
|
||||
--decoder=$repo/decoder.onnx \
|
||||
--joiner=$repo/joiner.onnx \
|
||||
--num-threads=2 \
|
||||
$repo/test_wavs/0.wav \
|
||||
$repo/test_wavs/1.wav \
|
||||
$repo/test_wavs/8k.wav
|
||||
|
||||
log "Test NeMo transducer with modified_beam_search (no hotwords)"
|
||||
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder.onnx \
|
||||
--decoder=$repo/decoder.onnx \
|
||||
--joiner=$repo/joiner.onnx \
|
||||
--num-threads=2 \
|
||||
--decoding-method=modified_beam_search \
|
||||
$repo/test_wavs/0.wav
|
||||
|
||||
log "Test NeMo transducer with modified_beam_search and hotwords"
|
||||
|
||||
# The model does not ship a bpe.vocab; derive one from tokens.txt so that
|
||||
# hotwords can be given as words. Equal scores make the encoder use the
|
||||
# longest match.
|
||||
awk '{print $1 "\t-1.0"}' $repo/tokens.txt > $repo/bpe.vocab
|
||||
|
||||
cat > $repo/hotwords.txt << EOF
|
||||
the
|
||||
and
|
||||
that
|
||||
EOF
|
||||
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder.onnx \
|
||||
--decoder=$repo/decoder.onnx \
|
||||
--joiner=$repo/joiner.onnx \
|
||||
--num-threads=2 \
|
||||
--decoding-method=modified_beam_search \
|
||||
--modeling-unit=bpe \
|
||||
--bpe-vocab=$repo/bpe.vocab \
|
||||
--hotwords-file=$repo/hotwords.txt \
|
||||
--hotwords-score=1.5 \
|
||||
$repo/test_wavs/0.wav > $repo/hotwords.log 2>&1
|
||||
|
||||
cat $repo/hotwords.log
|
||||
|
||||
case "$EXE" in
|
||||
*decode-file-c-api*)
|
||||
# prints only the text
|
||||
;;
|
||||
*)
|
||||
# the matched hotwords must carry the hotwords score in context_scores
|
||||
grep -q '"context_scores": \[[^]]*1.500000' $repo/hotwords.log
|
||||
;;
|
||||
esac
|
||||
|
||||
rm -rf $repo
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "Run LSTM transducer (English)"
|
||||
log "------------------------------------------------------------"
|
||||
|
||||
repo_url=https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-lstm-en-2023-02-17.tar.bz2
|
||||
download_and_extract $repo_url
|
||||
repo=sherpa-onnx-lstm-en-2023-02-17
|
||||
|
||||
log "Start testing ${repo_url}"
|
||||
|
||||
waves=(
|
||||
$repo/test_wavs/0.wav
|
||||
$repo/test_wavs/1.wav
|
||||
$repo/test_wavs/8k.wav
|
||||
)
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder-epoch-99-avg-1.onnx \
|
||||
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
|
||||
--joiner=$repo/joiner-epoch-99-avg-1.onnx \
|
||||
--num-threads=2 \
|
||||
$wave
|
||||
done
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder-epoch-99-avg-1.int8.onnx \
|
||||
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
|
||||
--joiner=$repo/joiner-epoch-99-avg-1.int8.onnx \
|
||||
--num-threads=2 \
|
||||
$wave
|
||||
done
|
||||
|
||||
rm -rf $repo
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "Run LSTM transducer (Chinese)"
|
||||
log "------------------------------------------------------------"
|
||||
|
||||
repo_url=https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-lstm-zh-2023-02-20.tar.bz2
|
||||
download_and_extract $repo_url
|
||||
repo=sherpa-onnx-lstm-zh-2023-02-20
|
||||
|
||||
log "Start testing ${repo_url}"
|
||||
|
||||
waves=(
|
||||
$repo/test_wavs/0.wav
|
||||
$repo/test_wavs/1.wav
|
||||
$repo/test_wavs/8k.wav
|
||||
)
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder-epoch-11-avg-1.onnx \
|
||||
--decoder=$repo/decoder-epoch-11-avg-1.onnx \
|
||||
--joiner=$repo/joiner-epoch-11-avg-1.onnx \
|
||||
--num-threads=2 \
|
||||
$wave
|
||||
done
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder-epoch-11-avg-1.int8.onnx \
|
||||
--decoder=$repo/decoder-epoch-11-avg-1.onnx \
|
||||
--joiner=$repo/joiner-epoch-11-avg-1.int8.onnx \
|
||||
--num-threads=2 \
|
||||
$wave
|
||||
done
|
||||
|
||||
rm -rf $repo
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "Run streaming Zipformer transducer (English)"
|
||||
log "------------------------------------------------------------"
|
||||
|
||||
repo_url=https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-en-2023-02-21.tar.bz2
|
||||
download_and_extract $repo_url
|
||||
repo=sherpa-onnx-streaming-zipformer-en-2023-02-21
|
||||
|
||||
log "Start testing ${repo_url}"
|
||||
|
||||
waves=(
|
||||
$repo/test_wavs/0.wav
|
||||
$repo/test_wavs/1.wav
|
||||
$repo/test_wavs/8k.wav
|
||||
)
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder-epoch-99-avg-1.onnx \
|
||||
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
|
||||
--joiner=$repo/joiner-epoch-99-avg-1.onnx \
|
||||
--num-threads=2 \
|
||||
$wave
|
||||
done
|
||||
|
||||
# test int8
|
||||
#
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder-epoch-99-avg-1.int8.onnx \
|
||||
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
|
||||
--joiner=$repo/joiner-epoch-99-avg-1.int8.onnx \
|
||||
--num-threads=2 \
|
||||
$wave
|
||||
done
|
||||
|
||||
lm_repo_url=https://huggingface.co/vsd-vector/icefall-librispeech-rnn-lm
|
||||
log "Download pre-trained RNN-LM model from ${lm_repo_url}"
|
||||
GIT_LFS_SKIP_SMUDGE=1 git clone $lm_repo_url
|
||||
lm_repo=$(basename $lm_repo_url)
|
||||
pushd $lm_repo
|
||||
git lfs pull --include "with-state-epoch-99-avg-1.onnx"
|
||||
popd
|
||||
|
||||
bigram_repo_url=https://huggingface.co/vsd-vector/librispeech_bigram_sherpa-onnx-zipformer-large-en-2023-06-26
|
||||
log "Download bi-gram LM from ${bigram_repo_url}"
|
||||
GIT_LFS_SKIP_SMUDGE=1 git clone $bigram_repo_url
|
||||
bigramlm_repo=$(basename $bigram_repo_url)
|
||||
pushd $bigramlm_repo
|
||||
git lfs pull --include "2gram.fst"
|
||||
popd
|
||||
|
||||
log "Start testing LODR"
|
||||
|
||||
waves=(
|
||||
$repo/test_wavs/0.wav
|
||||
$repo/test_wavs/1.wav
|
||||
$repo/test_wavs/8k.wav
|
||||
)
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder-epoch-99-avg-1.onnx \
|
||||
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
|
||||
--joiner=$repo/joiner-epoch-99-avg-1.onnx \
|
||||
--num-threads=2 \
|
||||
--decoding_method="modified_beam_search" \
|
||||
--lm=$lm_repo/with-state-epoch-99-avg-1.onnx \
|
||||
--lodr-fst=$bigramlm_repo/2gram.fst \
|
||||
--lodr-scale=-0.5 \
|
||||
$wave
|
||||
done
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder-epoch-99-avg-1.onnx \
|
||||
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
|
||||
--joiner=$repo/joiner-epoch-99-avg-1.onnx \
|
||||
--num-threads=2 \
|
||||
--decoding_method="modified_beam_search" \
|
||||
--lm=$lm_repo/with-state-epoch-99-avg-1.onnx \
|
||||
--lodr-fst=$bigramlm_repo/2gram.fst \
|
||||
--lodr-scale=-0.5 \
|
||||
--lm-shallow-fusion=true \
|
||||
$wave
|
||||
done
|
||||
|
||||
rm -rf $repo $bigramlm_repo $lm_repo
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "Run streaming Zipformer transducer (Bilingual, Chinese + English)"
|
||||
log "------------------------------------------------------------"
|
||||
|
||||
repo_url=https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2
|
||||
download_and_extract $repo_url
|
||||
repo=sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20
|
||||
|
||||
log "Start testing ${repo_url}"
|
||||
|
||||
waves=(
|
||||
$repo/test_wavs/0.wav
|
||||
$repo/test_wavs/1.wav
|
||||
$repo/test_wavs/2.wav
|
||||
$repo/test_wavs/3.wav
|
||||
$repo/test_wavs/8k.wav
|
||||
)
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder-epoch-99-avg-1.onnx \
|
||||
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
|
||||
--joiner=$repo/joiner-epoch-99-avg-1.onnx \
|
||||
--num-threads=2 \
|
||||
$wave
|
||||
done
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder-epoch-99-avg-1.int8.onnx \
|
||||
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
|
||||
--joiner=$repo/joiner-epoch-99-avg-1.int8.onnx \
|
||||
--num-threads=2 \
|
||||
$wave
|
||||
done
|
||||
|
||||
# Decode a URL
|
||||
if [ $EXE == "sherpa-onnx-ffmpeg" ]; then
|
||||
time $EXE \
|
||||
$repo/tokens.txt \
|
||||
$repo/encoder-epoch-99-avg-1.onnx \
|
||||
$repo/decoder-epoch-99-avg-1.onnx \
|
||||
$repo/joiner-epoch-99-avg-1.onnx \
|
||||
https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20/resolve/main/test_wavs/4.wav \
|
||||
2
|
||||
fi
|
||||
|
||||
if [ $EXE == "sherpa-onnx-ffmpeg" ]; then
|
||||
time $EXE \
|
||||
$repo/tokens.txt \
|
||||
$repo/encoder-epoch-99-avg-1.int8.onnx \
|
||||
$repo/decoder-epoch-99-avg-1.onnx \
|
||||
$repo/joiner-epoch-99-avg-1.int8.onnx \
|
||||
https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20/resolve/main/test_wavs/4.wav \
|
||||
2
|
||||
fi
|
||||
|
||||
rm -rf $repo
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "Run streaming Conformer transducer (English)"
|
||||
log "------------------------------------------------------------"
|
||||
|
||||
repo_url=https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-conformer-en-2023-05-09.tar.bz2
|
||||
download_and_extract $repo_url
|
||||
repo=sherpa-onnx-streaming-conformer-en-2023-05-09
|
||||
|
||||
log "Start testing ${repo_url}"
|
||||
|
||||
waves=(
|
||||
$repo/test_wavs/0.wav
|
||||
$repo/test_wavs/1.wav
|
||||
$repo/test_wavs/2.wav
|
||||
)
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder-epoch-99-avg-1.onnx \
|
||||
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
|
||||
--joiner=$repo/joiner-epoch-99-avg-1.onnx \
|
||||
--num-threads=2 \
|
||||
$wave
|
||||
done
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--encoder=$repo/encoder-epoch-99-avg-1.int8.onnx \
|
||||
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
|
||||
--joiner=$repo/joiner-epoch-99-avg-1.int8.onnx \
|
||||
--num-threads=2 \
|
||||
$wave
|
||||
done
|
||||
|
||||
rm -rf $repo
|
||||
Executable
+162
@@ -0,0 +1,162 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Tests every python-api-examples/test-offline-tts-*.py example.
|
||||
#
|
||||
# These cover the two text-frontend paths that replaced the removed espeak-ng
|
||||
# support:
|
||||
#
|
||||
# * *-lexicon.py -- pass a lexicon file, no external phonemizer needed
|
||||
# * *-phonemize.py -- phonemize outside sherpa-onnx (piper_phonemize,
|
||||
# pypinyin, misaki) and pass phoneme_codepoints
|
||||
# * *-tokens.py -- same as *-phonemize.py but pass token strings via
|
||||
# GenerationConfig.tokens (sherpa-onnx adds the
|
||||
# bos/pad/eos markers itself)
|
||||
#
|
||||
# Requires: piper_phonemize, pypinyin, misaki[zh], kaldifst, soundfile
|
||||
#
|
||||
# Note: misaki keeps its Chinese dependencies behind the "zh" extra, so
|
||||
# "misaki[zh]" (not bare "misaki") is required for `from misaki import zh`.
|
||||
set -e
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/common.sh"
|
||||
log() {
|
||||
# This function is from espnet
|
||||
local fname=${BASH_SOURCE[1]##*/}
|
||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
||||
}
|
||||
|
||||
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||
|
||||
echo "EXE is $EXE"
|
||||
echo "PATH: $PATH"
|
||||
|
||||
python3 -m pip install --upgrade soundfile
|
||||
python3 -m pip install --upgrade pypinyin 'misaki[zh]' kaldifst
|
||||
python3 -m pip install --upgrade piper_phonemize -f https://k2-fsa.github.io/icefall/piper_phonemize.html
|
||||
|
||||
# Import exactly what the examples import -- bare "import misaki" does NOT
|
||||
# exercise misaki.zh, which is where the extras-gated deps (cn2an, jieba,
|
||||
# pypinyin-dict) are needed.
|
||||
python3 -c "
|
||||
import kaldifst
|
||||
import numpy
|
||||
import soundfile
|
||||
import piper_phonemize
|
||||
from pypinyin import Style, lazy_pinyin
|
||||
from pypinyin.contrib.tone_convert import to_finals_tone3, to_initials
|
||||
from misaki import zh
|
||||
print('phonemizer deps OK')
|
||||
"
|
||||
|
||||
# test waves are saved in ./tts
|
||||
mkdir -p ./tts
|
||||
|
||||
LEXICON=https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
VOCOS_22=https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
VOCOS_16=https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-16khz-univ.onnx
|
||||
VOCOS_24=https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos_24khz.onnx
|
||||
|
||||
run() {
|
||||
# run <example.py> <wav produced by the example>
|
||||
local ex=$1
|
||||
local wav=$2
|
||||
log "Run $ex"
|
||||
python3 ./python-api-examples/$ex
|
||||
mv -v "$wav" ./tts/
|
||||
}
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "coqui (character frontend)"
|
||||
log "------------------------------------------------------------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-coqui-de-css10.tar.bz2
|
||||
run test-offline-tts-coqui-phonemize.py test-coqui-phonemize.wav
|
||||
rm -rf vits-coqui-de-css10
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "inflect (vits-ext)"
|
||||
log "------------------------------------------------------------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-inflect-en-nano-v2.tar.bz2
|
||||
download $LEXICON
|
||||
run test-offline-tts-inflect-lexicon.py test-inflect-lexicon.wav
|
||||
run test-offline-tts-inflect-phonemize.py test-inflect-phonemize.wav
|
||||
rm -rf vits-inflect-en-nano-v2 lexicon-en-us.txt
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "kitten"
|
||||
log "------------------------------------------------------------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kitten-micro-en-v0_8.tar.bz2
|
||||
download $LEXICON
|
||||
run test-offline-tts-kitten-lexicon.py test-kitten-lexicon.wav
|
||||
run test-offline-tts-kitten-phonemize.py test-kitten-phonemize.wav
|
||||
rm -rf kitten-micro-en-v0_8 lexicon-en-us.txt
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "kokoro en"
|
||||
log "------------------------------------------------------------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-en-v0_19.tar.bz2
|
||||
download $LEXICON
|
||||
run test-offline-tts-kokoro-en-lexicon.py test-kokoro-en-lexicon.wav
|
||||
run test-offline-tts-kokoro-en-phonemize.py test-kokoro-en-phonemize.wav
|
||||
rm -rf kokoro-en-v0_19 lexicon-en-us.txt
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "kokoro multi-lang"
|
||||
log "------------------------------------------------------------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-multi-lang-v1_0.tar.bz2
|
||||
run test-offline-tts-kokoro-multilang-lexicon.py test-kokoro-multilang-lexicon.wav
|
||||
run test-offline-tts-kokoro-multilang-phonemize.py test-kokoro-multilang-phonemize.wav
|
||||
rm -rf kokoro-multi-lang-v1_0
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "matcha en"
|
||||
log "------------------------------------------------------------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-en_US-ljspeech.tar.bz2
|
||||
download $VOCOS_22
|
||||
download $LEXICON
|
||||
run test-offline-tts-matcha-en-lexicon.py test-matcha-en-lexicon.wav
|
||||
run test-offline-tts-matcha-en-phonemize.py test-matcha-en-phonemize.wav
|
||||
rm -rf matcha-icefall-en_US-ljspeech lexicon-en-us.txt
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "matcha zh"
|
||||
log "------------------------------------------------------------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-baker.tar.bz2
|
||||
run test-offline-tts-matcha-zh-lexicon.py test-matcha-zh-lexicon.wav
|
||||
run test-offline-tts-matcha-zh-phonemize.py test-matcha-zh-phonemize.wav
|
||||
rm -rf matcha-icefall-zh-baker
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "matcha zh-en"
|
||||
log "------------------------------------------------------------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-en.tar.bz2
|
||||
download $VOCOS_16
|
||||
download $LEXICON
|
||||
run test-offline-tts-matcha-zh-en-lexicon.py test-matcha-zh-en-lexicon.wav
|
||||
run test-offline-tts-matcha-zh-en-phonemize.py test-matcha-zh-en-phonemize.wav
|
||||
rm -rf matcha-icefall-zh-en vocos-16khz-univ.onnx lexicon-en-us.txt
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "piper (vits)"
|
||||
log "------------------------------------------------------------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-amy-low.tar.bz2
|
||||
download $LEXICON
|
||||
run test-offline-tts-piper-lexicon.py test-piper-lexicon.wav
|
||||
run test-offline-tts-piper-phonemize.py test-piper-phonemize.wav
|
||||
run test-offline-tts-piper-tokens.py test-piper-tokens.wav
|
||||
rm -rf vits-piper-en_US-amy-low lexicon-en-us.txt
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "zipvoice"
|
||||
log "------------------------------------------------------------"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-zipvoice-distill-int8-zh-en-emilia.tar.bz2
|
||||
download $VOCOS_24
|
||||
download $LEXICON
|
||||
run test-offline-tts-zipvoice-lexicon.py test-zipvoice-lexicon.wav
|
||||
run test-offline-tts-zipvoice-phonemize.py test-zipvoice-phonemize.wav
|
||||
rm -rf sherpa-onnx-zipvoice-distill-int8-zh-en-emilia vocos_24khz.onnx lexicon-en-us.txt
|
||||
|
||||
# the 22 kHz vocoder is shared by matcha-en and matcha-zh
|
||||
rm -f vocos-22khz-univ.onnx
|
||||
|
||||
log "All test-offline-tts examples passed"
|
||||
ls -lh ./tts/
|
||||
@@ -87,12 +87,15 @@ download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts
|
||||
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos_24khz.onnx
|
||||
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
python3 ./python-api-examples/zipvoice-tts.py
|
||||
|
||||
cp generated-zipvoice-zh-en-python.wav tts/
|
||||
|
||||
rm -rf sherpa-onnx-zipvoice-distill-int8-zh-en-emilia
|
||||
rm -f vocos_24khz.onnx
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
log "test Google MedASR"
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-medasr-ctc-en-int8-2025-12-25.tar.bz2
|
||||
@@ -347,6 +350,19 @@ python3 ./python-api-examples/online-zipformer-ctc-hlg-decode-file.py \
|
||||
rm -rf sherpa-onnx-streaming-zipformer-ctc-small-2024-03-18
|
||||
|
||||
|
||||
log "test offline zipformer ctc HLG decoding"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-zipformer-ctc-en-2023-10-02.tar.bz2
|
||||
|
||||
python3 ./python-api-examples/offline-zipformer-ctc-hlg-decode-files.py \
|
||||
--tokens ./sherpa-onnx-zipformer-ctc-en-2023-10-02/tokens.txt \
|
||||
--model ./sherpa-onnx-zipformer-ctc-en-2023-10-02/model.int8.onnx \
|
||||
--graph ./sherpa-onnx-zipformer-ctc-en-2023-10-02/HLG.fst \
|
||||
./sherpa-onnx-zipformer-ctc-en-2023-10-02/test_wavs/0.wav
|
||||
|
||||
rm -rf sherpa-onnx-zipformer-ctc-en-2023-10-02
|
||||
|
||||
|
||||
mkdir -p /tmp/icefall-models
|
||||
dir=/tmp/icefall-models
|
||||
|
||||
@@ -428,19 +444,21 @@ mkdir -p ./tts
|
||||
log "test kitten tts"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kitten-nano-en-v0_1-fp16.tar.bz2
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
python3 ./python-api-examples/offline-tts.py \
|
||||
--debug=1 \
|
||||
--kitten-model=./kitten-nano-en-v0_1-fp16/model.fp16.onnx \
|
||||
--kitten-voices=./kitten-nano-en-v0_1-fp16/voices.bin \
|
||||
--kitten-tokens=./kitten-nano-en-v0_1-fp16/tokens.txt \
|
||||
--kitten-data-dir=./kitten-nano-en-v0_1-fp16/espeak-ng-data \
|
||||
--kitten-lexicon=./lexicon-en-us.txt \
|
||||
--num-threads=2 \
|
||||
--sid=0 \
|
||||
--output-filename="./tts/kitten-0.wav" \
|
||||
"Today as always, men fall into two groups: slaves and free men. Whoever does not have two-thirds of his day for himself, is a slave, whatever he may be: a statesman, a businessman, an official, or a scholar."
|
||||
|
||||
rm -rf kitten-nano-en-v0_1-fp16
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
log "kokoro-multi-lang-v1_0 test"
|
||||
|
||||
@@ -451,7 +469,6 @@ python3 ./python-api-examples/offline-tts.py \
|
||||
--kokoro-model=./kokoro-multi-lang-v1_0/model.onnx \
|
||||
--kokoro-voices=./kokoro-multi-lang-v1_0/voices.bin \
|
||||
--kokoro-tokens=./kokoro-multi-lang-v1_0/tokens.txt \
|
||||
--kokoro-data-dir=./kokoro-multi-lang-v1_0/espeak-ng-data \
|
||||
--kokoro-lexicon=./kokoro-multi-lang-v1_0/lexicon-us-en.txt,./kokoro-multi-lang-v1_0/lexicon-zh.txt \
|
||||
--num-threads=2 \
|
||||
--sid=18 \
|
||||
@@ -463,37 +480,41 @@ rm -rf kokoro-multi-lang-v1_0
|
||||
log "kokoro-en-v0_19 test"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-en-v0_19.tar.bz2
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
python3 ./python-api-examples/offline-tts.py \
|
||||
--debug=1 \
|
||||
--kokoro-model=./kokoro-en-v0_19/model.onnx \
|
||||
--kokoro-voices=./kokoro-en-v0_19/voices.bin \
|
||||
--kokoro-tokens=./kokoro-en-v0_19/tokens.txt \
|
||||
--kokoro-data-dir=./kokoro-en-v0_19/espeak-ng-data \
|
||||
--kokoro-lexicon=./lexicon-en-us.txt \
|
||||
--num-threads=2 \
|
||||
--sid=10 \
|
||||
--output-filename="./tts/kokoro-10.wav" \
|
||||
"Today as always, men fall into two groups: slaves and free men. Whoever does not have two-thirds of his day for himself, is a slave, whatever he may be a statesman, a businessman, an official, or a scholar."
|
||||
|
||||
rm -rf kokoro-en-v0_19
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
log "matcha-ljspeech-en test"
|
||||
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-en_US-ljspeech.tar.bz2
|
||||
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
python3 ./python-api-examples/offline-tts.py \
|
||||
--matcha-acoustic-model=./matcha-icefall-en_US-ljspeech/model-steps-3.onnx \
|
||||
--matcha-vocoder=./vocos-22khz-univ.onnx \
|
||||
--matcha-tokens=./matcha-icefall-en_US-ljspeech/tokens.txt \
|
||||
--matcha-data-dir=./matcha-icefall-en_US-ljspeech/espeak-ng-data \
|
||||
--matcha-lexicon=./lexicon-en-us.txt \
|
||||
--output-filename=./tts/test-matcha-ljspeech-en.wav \
|
||||
--num-threads=2 \
|
||||
"Today as always, men fall into two groups: slaves and free men. Whoever does not have two-thirds of his day for himself, is a slave, whatever he may be: a statesman, a businessman, an official, or a scholar."
|
||||
|
||||
rm vocos-22khz-univ.onnx
|
||||
rm -rf matcha-icefall-en_US-ljspeech
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
log "matcha-baker-zh test"
|
||||
|
||||
|
||||
@@ -9,6 +9,43 @@ trap 'bash ../.github/scripts/show-rust-binary-info.sh --all || true' EXIT
|
||||
|
||||
bash ./run-version.sh
|
||||
|
||||
bash ./run-vits-en-lexicon.sh
|
||||
bash ./run-vits-en-phonemize.sh
|
||||
rm -rf vits-piper-en_US-amy-low
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
bash ./run-vits-de-phonemize.sh
|
||||
rm -rf vits-piper-de_DE-glados-high
|
||||
|
||||
bash ./run-matcha-tts-en-lexicon.sh
|
||||
bash ./run-matcha-tts-en-phonemize.sh
|
||||
bash ./run-matcha-tts-zh-lexicon.sh
|
||||
rm -rf matcha-icefall-en_US-ljspeech matcha-icefall-zh-baker
|
||||
rm -f vocos-22khz-univ.onnx lexicon-en-us.txt
|
||||
|
||||
bash ./run-kokoro-tts-en-lexicon.sh
|
||||
bash ./run-kokoro-tts-en-phonemize.sh
|
||||
rm -rf kokoro-en-v0_19
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
bash ./run-kokoro-tts-zh-en-lexicon.sh
|
||||
rm -rf kokoro-multi-lang-v1_0
|
||||
|
||||
bash ./run-kitten-tts-en-lexicon.sh
|
||||
bash ./run-kitten-tts-en-phonemize.sh
|
||||
rm -rf kitten-nano-en-v0_1-fp16
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
bash ./run-pocket-tts.sh
|
||||
rm -rf sherpa-onnx-pocket-*
|
||||
|
||||
bash ./run-supertonic-tts.sh
|
||||
rm -rf sherpa-onnx-supertonic-*
|
||||
|
||||
bash ./run-zipvoice-tts-lexicon.sh
|
||||
rm -rf sherpa-onnx-zipvoice-*
|
||||
rm -f vocos_24khz.onnx lexicon-en-us.txt
|
||||
|
||||
bash ./run-qwen3-asr.sh
|
||||
rm -rf sherpa-onnx-qwen3-*
|
||||
|
||||
@@ -33,36 +70,6 @@ bash ./run-offline-speaker-diarization.sh
|
||||
rm -rf sherpa-onnx-pyannote-segmentation-3-0
|
||||
rm -f 3dspeaker_speech_eres2net_base_sv_zh-cn_3dspeaker_16k.onnx 0-four-speakers-zh.wav
|
||||
|
||||
bash ./run-vits-en.sh
|
||||
rm -rf vits-piper-en_US-amy-low
|
||||
|
||||
bash ./run-vits-de.sh
|
||||
rm -rf vits-piper-de_DE-glados-high
|
||||
|
||||
bash ./run-matcha-tts-en.sh
|
||||
bash ./run-matcha-tts-zh.sh
|
||||
rm -rf matcha-icefall-en_US-ljspeech matcha-icefall-zh-baker
|
||||
rm -f vocos-22khz-univ.onnx
|
||||
|
||||
bash ./run-kokoro-tts-en.sh
|
||||
rm -rf kokoro-en-v0_19
|
||||
|
||||
bash ./run-kokoro-tts-zh-en.sh
|
||||
rm -rf kokoro-multi-lang-v1_0
|
||||
|
||||
bash ./run-kitten-tts-en.sh
|
||||
rm -rf kitten-nano-en-v0_1-fp16
|
||||
|
||||
bash ./run-pocket-tts.sh
|
||||
rm -rf sherpa-onnx-pocket-*
|
||||
|
||||
bash ./run-supertonic-tts.sh
|
||||
rm -rf sherpa-onnx-supertonic-*
|
||||
|
||||
bash ./run-zipvoice-tts.sh
|
||||
rm -rf sherpa-onnx-zipvoice-*
|
||||
rm -f vocos_24khz.onnx
|
||||
|
||||
bash ./run-online-punctuation.sh
|
||||
rm -rf sherpa-onnx-online-punct-*
|
||||
|
||||
@@ -91,11 +98,15 @@ bash ./run-nemo-parakeet-en.sh
|
||||
bash ./run-zipformer-vi.sh
|
||||
bash ./run-zipformer-zh-en.sh
|
||||
bash ./run-zipformer-en.sh
|
||||
bash ./run-zipformer-ctc-hlg.sh
|
||||
rm -rf sherpa-onnx-zipformer-ctc-en-2023-10-02
|
||||
|
||||
bash ./run-sense-voice.sh
|
||||
|
||||
bash ./run-streaming-zipformer-en.sh
|
||||
bash ./run-streaming-zipformer-zh-en.sh
|
||||
bash ./run-streaming-zipformer-ctc-hlg.sh
|
||||
rm -rf sherpa-onnx-streaming-zipformer-ctc-small-2024-03-18
|
||||
|
||||
bash ./run-offline-speech-enhancement-gtcrn.sh
|
||||
bash ./run-offline-speech-enhancement-dpdfnet.sh
|
||||
|
||||
@@ -8,6 +8,46 @@ echo "pwd: $PWD"
|
||||
cd swift-api-examples
|
||||
ls -lh
|
||||
|
||||
./run-test-version.sh
|
||||
|
||||
./run-tts-pocket-en.sh
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-pocket-*
|
||||
|
||||
./run-tts-supertonic-en.sh
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-supertonic-*
|
||||
|
||||
./run-tts-kitten-en-lexicon.sh
|
||||
ls -lh
|
||||
rm -rf kitten-*
|
||||
|
||||
./run-tts-vits-lexicon.sh
|
||||
ls -lh
|
||||
rm -rf vits-piper-*
|
||||
|
||||
./run-tts-kokoro-zh-en-lexicon.sh
|
||||
ls -lh
|
||||
rm -rf kokoro-multi-*
|
||||
|
||||
./run-tts-kokoro-en-lexicon.sh
|
||||
ls -lh
|
||||
rm -rf kokoro-en-*
|
||||
|
||||
./run-tts-matcha-zh-lexicon.sh
|
||||
ls -lh
|
||||
rm -rf matcha-icefall-*
|
||||
|
||||
./run-tts-matcha-en-lexicon.sh
|
||||
ls -lh
|
||||
rm -rf matcha-icefall-*
|
||||
|
||||
./run-tts-zipvoice-lexicon.sh
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-zipvoice-*
|
||||
rm -f vocos_24khz.onnx
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
./run-cohere-transcribe.sh
|
||||
rm -rf sherpa-onnx-cohere-transcribe-*
|
||||
|
||||
@@ -23,22 +63,12 @@ rm -f qi-feng-le-zh.wav
|
||||
./run-qwen3-asr.sh
|
||||
rm -rf sherpa-onnx-qwen3-*
|
||||
|
||||
./run-test-version.sh
|
||||
|
||||
./run-moonshine-v2-asr.sh
|
||||
rm -rf sherpa-onnx-moonshine-*
|
||||
|
||||
./run-fire-red-asr-ctc.sh
|
||||
rm -rf sherpa-onnx-fire-red-*
|
||||
|
||||
./run-tts-pocket-en.sh
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-pocket-*
|
||||
|
||||
./run-tts-supertonic-en.sh
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-supertonic-*
|
||||
|
||||
./run-medasr-ctc-asr.sh
|
||||
rm -rf sherpa-onnx-medasr-*
|
||||
|
||||
@@ -52,11 +82,7 @@ rm -rf sherpa-onnx-omnilingual-*
|
||||
rm -rf sherpa-onnx-streaming-*
|
||||
|
||||
./run-compute-speaker-embeddings.sh
|
||||
rm -fv *.wav *.onnx
|
||||
|
||||
./run-tts-kitten-en.sh
|
||||
ls -lh
|
||||
rm -rf kitten-*
|
||||
rm -f wespeaker_zh_cnceleb_resnet34.onnx fangjun-sr-1.wav fangjun-sr-2.wav leijun-sr-1.wav
|
||||
|
||||
./run-wenet-ctc-asr.sh
|
||||
rm -rf sherpa-onnx-*
|
||||
@@ -64,6 +90,9 @@ rm -rf sherpa-onnx-*
|
||||
./run-zipformer-ctc-asr.sh
|
||||
rm -rf sherpa-onnx-zipformer-*
|
||||
|
||||
./run-zipformer-ctc-hlg.sh
|
||||
rm -rf sherpa-onnx-zipformer-*
|
||||
|
||||
./run-decode-file-sense-voice-with-hr.sh
|
||||
rm -rf sherpa-onnx-sense-voice-*
|
||||
rm -rf dict lexicon.txt replace.fst test-hr.wav
|
||||
@@ -80,35 +109,9 @@ ls -lh *.wav
|
||||
./run-fire-red-asr.sh
|
||||
rm -rf sherpa-onnx-fire-red-asr-*
|
||||
|
||||
./run-tts-vits.sh
|
||||
ls -lh
|
||||
rm -rf vits-piper-*
|
||||
|
||||
./run-tts-kokoro-zh-en.sh
|
||||
ls -lh
|
||||
rm -rf kokoro-multi-*
|
||||
|
||||
./run-tts-kokoro-en.sh
|
||||
ls -lh
|
||||
rm -rf kokoro-en-*
|
||||
|
||||
./run-tts-matcha-zh.sh
|
||||
ls -lh
|
||||
rm -rf matcha-icefall-*
|
||||
|
||||
./run-tts-matcha-en.sh
|
||||
ls -lh
|
||||
rm -rf matcha-icefall-*
|
||||
|
||||
./run-tts-zipvoice.sh
|
||||
ls -lh
|
||||
rm -rf sherpa-onnx-zipvoice-*
|
||||
rm -f vocos_24khz.onnx
|
||||
|
||||
./run-speaker-diarization.sh
|
||||
rm -rf *.onnx
|
||||
rm -f 3dspeaker_speech_eres2net_base_sv_zh-cn_3dspeaker_16k.onnx 0-four-speakers-zh.wav
|
||||
rm -rf sherpa-onnx-pyannote-segmentation-3-0
|
||||
rm -fv *.wav
|
||||
|
||||
./run-add-punctuations.sh
|
||||
rm ./add-punctuations
|
||||
|
||||
@@ -88,8 +88,6 @@ jobs:
|
||||
cp -v bin/zipformer-ctc-simulate-streaming-alsa-cxx-api install/bin
|
||||
|
||||
rm -rf install/lib/pkgconfig
|
||||
rm -fv install/lib/cargs.h
|
||||
rm -fv install/lib/libcargs.so
|
||||
|
||||
- name: Build sherpa-onnx
|
||||
if: matrix.gpu == 'OFF'
|
||||
@@ -139,8 +137,6 @@ jobs:
|
||||
cp -v bin/zipformer-ctc-simulate-streaming-alsa-cxx-api install/bin
|
||||
|
||||
rm -rf install/lib/pkgconfig
|
||||
rm -fv install/lib/cargs.h
|
||||
rm -fv install/lib/libcargs.so
|
||||
'
|
||||
|
||||
- name: Display system info
|
||||
@@ -202,7 +198,6 @@ jobs:
|
||||
lib_dst=${dst}-lib
|
||||
mkdir -p ${lib_dst}/lib
|
||||
cp -av build/install/lib/lib*.so* ${lib_dst}/lib/
|
||||
rm -f ${lib_dst}/lib/libcargs.so ${lib_dst}/lib/libcargs.so.*
|
||||
tree ${lib_dst}
|
||||
tar cjvf ${lib_dst}.tar.bz2 ${lib_dst}
|
||||
|
||||
@@ -220,7 +215,7 @@ jobs:
|
||||
file: sherpa-onnx-*.tar.bz2
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: v1.12.32
|
||||
tag: v1.13.8
|
||||
|
||||
- name: Release pre-compiled binaries and libs for linux aarch64
|
||||
if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||
|
||||
@@ -105,7 +105,6 @@ jobs:
|
||||
ls -lh install/lib
|
||||
|
||||
rm -rf install/lib/pkgconfig
|
||||
rm -fv install/lib/cargs.h
|
||||
'
|
||||
|
||||
- name: Copy files
|
||||
@@ -131,7 +130,6 @@ jobs:
|
||||
lib_dst=${dst}-lib
|
||||
mkdir -p ${lib_dst}/lib
|
||||
cp -av build/install/lib/lib*.a ${lib_dst}/lib/
|
||||
rm -f ${lib_dst}/lib/libcargs.a
|
||||
tree ${lib_dst}
|
||||
tar cjvf ${lib_dst}.tar.bz2 ${lib_dst}
|
||||
|
||||
@@ -149,7 +147,7 @@ jobs:
|
||||
file: sherpa-onnx-*.tar.bz2
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: v1.12.32
|
||||
tag: v1.13.8
|
||||
|
||||
- name: Release pre-compiled binaries and libs for linux aarch64
|
||||
if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||
|
||||
@@ -139,7 +139,7 @@ jobs:
|
||||
file: sherpa-onnx-*-android-rknn.tar.bz2
|
||||
# repo_name: k2-fsa/sherpa-onnx
|
||||
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
# tag: v1.12.17
|
||||
# tag: v1.13.8
|
||||
|
||||
build-android-aar-rknn:
|
||||
needs: [build-android-rknn-libs]
|
||||
@@ -274,7 +274,7 @@ jobs:
|
||||
file: ./*.aar
|
||||
# repo_name: k2-fsa/sherpa-onnx
|
||||
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
# tag: v1.12.17
|
||||
# tag: v1.13.8
|
||||
|
||||
- name: Release android aar
|
||||
if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||
|
||||
@@ -171,7 +171,7 @@ jobs:
|
||||
file: sherpa-onnx-*-android*.tar.bz2
|
||||
# repo_name: k2-fsa/sherpa-onnx
|
||||
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
# tag: v1.12.17
|
||||
# tag: v1.13.8
|
||||
|
||||
build-android-aar-static:
|
||||
needs: [build-android-static-libs]
|
||||
@@ -306,4 +306,4 @@ jobs:
|
||||
file: ./*.aar
|
||||
# repo_name: k2-fsa/sherpa-onnx
|
||||
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
# tag: v1.12.17
|
||||
# tag: v1.13.8
|
||||
@@ -177,4 +177,4 @@ jobs:
|
||||
file: sherpa-onnx-*linux-arm-gnueabihf*.tar.bz2
|
||||
# repo_name: k2-fsa/sherpa-onnx
|
||||
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
# tag: v1.12.0
|
||||
# tag: v1.13.8
|
||||
@@ -112,8 +112,6 @@ jobs:
|
||||
make -j4 install
|
||||
|
||||
rm -rf install/lib/pkgconfig
|
||||
rm -fv install/lib/cargs.h
|
||||
rm -fv install/lib/libcargs.so
|
||||
'
|
||||
|
||||
- name: Display system info
|
||||
@@ -234,4 +232,4 @@ jobs:
|
||||
file: sherpa-onnx-*linux-aarch64*.tar.bz2
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: v1.12.19
|
||||
tag: v1.13.8
|
||||
@@ -123,8 +123,6 @@ jobs:
|
||||
make -j4 install
|
||||
|
||||
rm -rf install/lib/pkgconfig
|
||||
rm -fv install/lib/cargs.h
|
||||
rm -fv install/lib/libcargs.so
|
||||
'
|
||||
|
||||
- name: Display system info
|
||||
@@ -247,4 +245,4 @@ jobs:
|
||||
file: sherpa-onnx-*linux-aarch64*.tar.bz2
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: v1.12.19
|
||||
tag: v1.13.8
|
||||
@@ -104,8 +104,6 @@ jobs:
|
||||
echo "----"
|
||||
ls -lh install/lib
|
||||
|
||||
rm -fv install/lib/libcargs.so
|
||||
|
||||
echo "----"
|
||||
ls -lh install/bin
|
||||
|
||||
|
||||
@@ -71,10 +71,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_TTS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=ON \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=ON \
|
||||
-DBUILD_PIPER_PHONMIZE_EXE=OFF \
|
||||
-DBUILD_PIPER_PHONMIZE_TESTS=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DBUILD_ESPEAK_NG_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
|
||||
@@ -106,7 +102,6 @@ jobs:
|
||||
cp -v ./install/lib/lib*.so ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib
|
||||
mkdir -p ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api
|
||||
cp -v ./install/include/sherpa-onnx/c-api/*.h ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api
|
||||
rm -fv ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib/libcargs.so
|
||||
rm -fv ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib/libonnxruntime4j_jni.so
|
||||
|
||||
pushd ../scripts/wheel/sherpa-onnx-core
|
||||
|
||||
@@ -80,10 +80,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_TTS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=ON \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=ON \
|
||||
-DBUILD_PIPER_PHONMIZE_EXE=OFF \
|
||||
-DBUILD_PIPER_PHONMIZE_TESTS=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DBUILD_ESPEAK_NG_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
|
||||
@@ -115,7 +111,6 @@ jobs:
|
||||
cp -v ./install/lib/lib*.so ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib
|
||||
mkdir -p ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api
|
||||
cp -v ./install/include/sherpa-onnx/c-api/*.h ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api
|
||||
rm -fv ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib/libcargs.so
|
||||
rm -fv ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib/libonnxruntime4j_jni.so
|
||||
|
||||
pushd ../scripts/wheel/sherpa-onnx-core
|
||||
|
||||
@@ -80,10 +80,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_TTS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=ON \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=ON \
|
||||
-DBUILD_PIPER_PHONMIZE_EXE=OFF \
|
||||
-DBUILD_PIPER_PHONMIZE_TESTS=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DBUILD_ESPEAK_NG_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
|
||||
@@ -115,7 +111,6 @@ jobs:
|
||||
cp -v ./install/lib/lib*.so ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib
|
||||
mkdir -p ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api
|
||||
cp -v ./install/include/sherpa-onnx/c-api/*.h ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api
|
||||
rm -fv ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib/libcargs.so
|
||||
rm -fv ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib/libonnxruntime4j_jni.so
|
||||
|
||||
pushd ../scripts/wheel/sherpa-onnx-core
|
||||
|
||||
@@ -80,10 +80,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_TTS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=ON \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=ON \
|
||||
-DBUILD_PIPER_PHONMIZE_EXE=OFF \
|
||||
-DBUILD_PIPER_PHONMIZE_TESTS=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DBUILD_ESPEAK_NG_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
|
||||
@@ -115,7 +111,6 @@ jobs:
|
||||
cp -v ./install/lib/lib*.so ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib
|
||||
mkdir -p ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api
|
||||
cp -v ./install/include/sherpa-onnx/c-api/*.h ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api
|
||||
rm -fv ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib/libcargs.so
|
||||
rm -fv ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib/libonnxruntime4j_jni.so
|
||||
|
||||
pushd ../scripts/wheel/sherpa-onnx-core
|
||||
|
||||
@@ -114,8 +114,6 @@ jobs:
|
||||
|
||||
file install/lib/*
|
||||
|
||||
rm -fv install/lib/libcargs.so
|
||||
|
||||
echo "----"
|
||||
ls -lh install/bin
|
||||
|
||||
|
||||
@@ -114,8 +114,6 @@ jobs:
|
||||
echo "----"
|
||||
ls -lh install/lib
|
||||
|
||||
rm -fv install/lib/libcargs.so
|
||||
|
||||
echo "----"
|
||||
ls -lh install/bin
|
||||
|
||||
|
||||
@@ -85,11 +85,6 @@ jobs:
|
||||
ls -lh bin
|
||||
|
||||
file ./bin/sherpa-onnx
|
||||
|
||||
rm -fv ./install/include/cargs.h
|
||||
rm -fv ./install/lib/cargs.h
|
||||
rm -fv ./install/lib/libcargs.dylib
|
||||
rm -fv ./install/lib/libcargs.a
|
||||
rm -rfv ./install/lib/pkgconfig
|
||||
|
||||
- name: Copy files
|
||||
|
||||
@@ -85,11 +85,6 @@ jobs:
|
||||
ls -lh bin
|
||||
|
||||
file ./bin/sherpa-onnx
|
||||
|
||||
rm -fv ./install/include/cargs.h
|
||||
rm -fv ./install/lib/cargs.h
|
||||
rm -fv ./install/lib/libcargs.dylib
|
||||
rm -fv ./install/lib/libcargs.a
|
||||
rm -rfv ./install/lib/pkgconfig
|
||||
|
||||
- name: Copy files
|
||||
|
||||
@@ -86,11 +86,6 @@ jobs:
|
||||
ls -lh bin
|
||||
|
||||
file ./bin/sherpa-onnx
|
||||
|
||||
rm -fv ./install/include/cargs.h
|
||||
rm -fv ./install/lib/cargs.h
|
||||
rm -fv ./install/lib/libcargs.dylib
|
||||
rm -fv ./install/lib/libcargs.a
|
||||
rm -rfv ./install/lib/pkgconfig
|
||||
|
||||
- name: Copy files
|
||||
|
||||
@@ -513,15 +513,13 @@ jobs:
|
||||
# Restore root Package.swift for static test (already patched with local paths)
|
||||
# Patch ios-swiftui/ios-swift xcodeproj files to use local package
|
||||
find ios-swiftui ios-swift -name "project.pbxproj" -exec sed -i '' \
|
||||
-e 's|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|' \
|
||||
-e 's|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|' \
|
||||
-e '/requirement = {/,/};/d' \
|
||||
-e '/\/\* XCRemoteSwiftPackageReference "sherpa-onnx" \*\/ = {/,/^\t\t};/{s|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|;s|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|;/requirement = {/,/};/d;}' \
|
||||
{} +
|
||||
|
||||
# Ensure we're using the static product in spm-examples
|
||||
# (Root Package.swift already has static binary targets patched to local paths)
|
||||
|
||||
for app in SherpaOnnxAsr SherpaOnnx2Pass SherpaOnnxTts; do
|
||||
for app in SherpaOnnxAsr SherpaOnnx2Pass SherpaOnnxTtsLexicon SherpaOnnxTtsPhonemize; do
|
||||
echo "=== Building ios-swiftui/$app (static, local SPM) ==="
|
||||
cd ios-swiftui/$app
|
||||
xcodebuild -project $app.xcodeproj \
|
||||
@@ -560,7 +558,7 @@ jobs:
|
||||
open('Package.swift', 'w').write(text)
|
||||
"
|
||||
|
||||
for app in SherpaOnnxAsr SherpaOnnx2Pass SherpaOnnxTts; do
|
||||
for app in SherpaOnnxAsr SherpaOnnx2Pass SherpaOnnxTtsLexicon SherpaOnnxTtsPhonemize; do
|
||||
echo "=== Building ios-swiftui/$app (shared, local SPM) ==="
|
||||
cd ios-swiftui/$app
|
||||
xcodebuild -project $app.xcodeproj \
|
||||
|
||||
@@ -1003,6 +1003,8 @@ jobs:
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos_24khz.onnx
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
export LD_LIBRARY_PATH=$PWD/build/install/lib:$LD_LIBRARY_PATH
|
||||
export DYLD_LIBRARY_PATH=$PWD/build/install/lib:$DYLD_LIBRARY_PATH
|
||||
|
||||
@@ -1011,6 +1013,7 @@ jobs:
|
||||
rm $name
|
||||
rm -rf sherpa-onnx-zipvoice-distill-int8-zh-en-emilia
|
||||
rm -f vocos_24khz.onnx
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
ls -lh ./generated-zipvoice-zh-en-c.wav
|
||||
|
||||
@@ -1035,6 +1038,8 @@ jobs:
|
||||
tar xf kitten-nano-en-v0_1-fp16.tar.bz2
|
||||
rm kitten-nano-en-v0_1-fp16.tar.bz2
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
export LD_LIBRARY_PATH=$PWD/build/install/lib:$LD_LIBRARY_PATH
|
||||
export DYLD_LIBRARY_PATH=$PWD/build/install/lib:$DYLD_LIBRARY_PATH
|
||||
|
||||
@@ -1042,6 +1047,7 @@ jobs:
|
||||
|
||||
rm $name
|
||||
rm -rf kitten-nano-en-v0_1-fp16
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -1082,6 +1088,8 @@ jobs:
|
||||
tar xf kokoro-en-v0_19.tar.bz2
|
||||
rm kokoro-en-v0_19.tar.bz2
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
export LD_LIBRARY_PATH=$PWD/build/install/lib:$LD_LIBRARY_PATH
|
||||
export DYLD_LIBRARY_PATH=$PWD/build/install/lib:$DYLD_LIBRARY_PATH
|
||||
|
||||
@@ -1089,6 +1097,7 @@ jobs:
|
||||
|
||||
rm ./kokoro-tts-en-c-api
|
||||
rm -rf kokoro-en-*
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -1134,6 +1143,8 @@ jobs:
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
export LD_LIBRARY_PATH=$PWD/build/install/lib:$LD_LIBRARY_PATH
|
||||
export DYLD_LIBRARY_PATH=$PWD/build/install/lib:$DYLD_LIBRARY_PATH
|
||||
|
||||
@@ -1142,6 +1153,7 @@ jobs:
|
||||
rm ./matcha-tts-en-c-api
|
||||
rm -rf matcha-icefall-*
|
||||
rm vocos-22khz-univ.onnx
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
||||
@@ -243,6 +243,35 @@ jobs:
|
||||
rm -rf sherpa-onnx-zipformer-ctc-en-*
|
||||
rm -v ./$name
|
||||
|
||||
- name: Test streaming Zipformer CTC with an HLG graph
|
||||
shell: bash
|
||||
run: |
|
||||
name=streaming-hlg-decode-file-cxx-api
|
||||
g++ -std=c++17 -o $name ./cxx-api-examples/$name.cc \
|
||||
-I ./build/install/include \
|
||||
-L ./build/install/lib/ \
|
||||
-l sherpa-onnx-cxx-api \
|
||||
-l sherpa-onnx-c-api \
|
||||
-l onnxruntime
|
||||
|
||||
ls -lh $name
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-ctc-small-2024-03-18.tar.bz2
|
||||
tar xvf sherpa-onnx-streaming-zipformer-ctc-small-2024-03-18.tar.bz2
|
||||
rm sherpa-onnx-streaming-zipformer-ctc-small-2024-03-18.tar.bz2
|
||||
|
||||
echo "---"
|
||||
|
||||
# A clean exit proves nothing here: without a graph the decoder
|
||||
# still succeeds, it just decodes freely. The word ids show up only
|
||||
# when the FST decoder ran.
|
||||
./$name > /tmp/hlg-streaming.txt 2>&1
|
||||
cat /tmp/hlg-streaming.txt
|
||||
grep -q '"words": \[[0-9]' /tmp/hlg-streaming.txt
|
||||
|
||||
rm -rf sherpa-onnx-streaming-zipformer-ctc-*
|
||||
rm -v ./$name
|
||||
|
||||
- name: Test FunASR Nano
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -818,12 +847,15 @@ jobs:
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos_24khz.onnx
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
echo "---"
|
||||
|
||||
./$name
|
||||
|
||||
rm -rf sherpa-onnx-zipvoice-distill-int8-zh-en-emilia
|
||||
rm -f vocos_24khz.onnx
|
||||
rm -f lexicon-en-us.txt
|
||||
rm -v ./$name
|
||||
|
||||
ls -lh ./generated-zipvoice-zh-en-cxx.wav
|
||||
@@ -850,11 +882,14 @@ jobs:
|
||||
tar xf kitten-nano-en-v0_1-fp16.tar.bz2
|
||||
rm kitten-nano-en-v0_1-fp16.tar.bz2
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
echo "---"
|
||||
|
||||
./$name
|
||||
|
||||
rm -rf kitten-nano-en-v0_1-fp16
|
||||
rm -f lexicon-en-us.txt
|
||||
rm -v ./$name
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
@@ -895,10 +930,13 @@ jobs:
|
||||
tar xf kokoro-en-v0_19.tar.bz2
|
||||
rm kokoro-en-v0_19.tar.bz2
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
./kokoro-tts-en-cxx-api
|
||||
|
||||
rm kokoro-tts-en-cxx-api
|
||||
rm -rf kokoro-en-*
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -943,11 +981,14 @@ jobs:
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
./matcha-tts-en-cxx-api
|
||||
|
||||
rm matcha-tts-en-cxx-api
|
||||
rm -rf matcha-icefall-*
|
||||
rm vocos-22khz-univ.onnx
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -971,9 +1012,12 @@ jobs:
|
||||
tar xf vits-piper-en_US-lessac-medium.tar.bz2
|
||||
rm vits-piper-en_US-lessac-medium.tar.bz2
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
./$name
|
||||
|
||||
rm -rf vits-piper-en_US-lessac-medium
|
||||
rm -f lexicon-en-us.txt
|
||||
rm -v ./$name
|
||||
|
||||
ls -lh ./generated-piper-en-cxx.wav
|
||||
|
||||
@@ -54,7 +54,6 @@ jobs:
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=ON \
|
||||
..
|
||||
|
||||
@@ -1,526 +0,0 @@
|
||||
name: flutter-android
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- flutter
|
||||
- apk
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: flutter-android-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
asr:
|
||||
if: false
|
||||
name: asr ${{ matrix.index }}/${{ matrix.total }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
total: ["3"]
|
||||
index: ["0", "1", "2"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
- name: Check Java version
|
||||
run: |
|
||||
java -version
|
||||
echo $JAVA_HOME
|
||||
|
||||
- name: Set JAVA_HOME for Gradle
|
||||
run: echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
|
||||
|
||||
- name: Check Java version
|
||||
run: |
|
||||
java -version
|
||||
echo $JAVA_HOME
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: Display NDK HOME
|
||||
shell: bash
|
||||
run: |
|
||||
echo "ANDROID_NDK_LATEST_HOME: ${ANDROID_NDK_LATEST_HOME}"
|
||||
ls -lh ${ANDROID_NDK_LATEST_HOME}
|
||||
|
||||
- name: Setup build tool version variable
|
||||
shell: bash
|
||||
run: |
|
||||
echo "---"
|
||||
ls -lh /usr/local/lib/android/
|
||||
echo "---"
|
||||
|
||||
ls -lh /usr/local/lib/android/sdk
|
||||
echo "---"
|
||||
|
||||
ls -lh /usr/local/lib/android/sdk/build-tools
|
||||
echo "---"
|
||||
|
||||
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
|
||||
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV
|
||||
echo "Last build tool version is: $BUILD_TOOL_VERSION"
|
||||
|
||||
- name: Install Python dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install --upgrade jinja2 iso639-lang
|
||||
|
||||
- name: Install deps
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y build-essential jq git cmake
|
||||
sudo apt-get install -y curl
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: 3.29.0
|
||||
cache: true
|
||||
|
||||
- name: Install ninja
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get install -y ninja-build
|
||||
|
||||
- name: Display ninja version
|
||||
shell: bash
|
||||
run: |
|
||||
ninja --version
|
||||
ninja --help || true
|
||||
which ninja
|
||||
|
||||
- name: Display PWD
|
||||
shell: bash
|
||||
run: |
|
||||
echo "pwd: $PWD"
|
||||
ls -lh
|
||||
|
||||
- name: Display machine info
|
||||
shell: bash
|
||||
run: |
|
||||
uname -a
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
|
||||
flutter --version
|
||||
|
||||
git config --global --add safe.directory /__t/flutter-Linux-*/flutter || true
|
||||
|
||||
flutter --version
|
||||
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Install libgtk-3-dev
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt install -y libgtk-3-dev tree clang pkg-config
|
||||
|
||||
- name: Accept Android licenses
|
||||
run: yes | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --licenses
|
||||
|
||||
- name: Install Android SDK Components
|
||||
run: |
|
||||
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager "platforms;android-35" "build-tools;35.0.0"
|
||||
|
||||
- name: Install NDK 27
|
||||
run: |
|
||||
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager "ndk;27.0.12077973"
|
||||
|
||||
- name: Display flutter info (2)
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
cd ..
|
||||
|
||||
- name: Build flutter
|
||||
shell: bash
|
||||
run: |
|
||||
cd scripts/flutter
|
||||
|
||||
total=${{ matrix.total }}
|
||||
index=${{ matrix.index }}
|
||||
|
||||
./generate-streaming-asr.py --total $total --index $index
|
||||
|
||||
chmod +x *.sh
|
||||
./build-android-streaming-asr.sh
|
||||
|
||||
cd ../../
|
||||
|
||||
ls -lh *.apk
|
||||
|
||||
- name: Display generated files
|
||||
shell: bash
|
||||
run: |
|
||||
ls -lh *.apk
|
||||
|
||||
mkdir apks
|
||||
|
||||
mv -v *.apk ./apks
|
||||
|
||||
# https://github.com/marketplace/actions/sign-android-release
|
||||
- uses: r0adkll/sign-android-release@v1
|
||||
name: Sign app APK
|
||||
with:
|
||||
releaseDirectory: ./apks
|
||||
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }}
|
||||
alias: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }}
|
||||
keyStorePassword: ${{ secrets.ANDROID_SIGNING_KEY_STORE_PASSWORD }}
|
||||
env:
|
||||
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
|
||||
|
||||
- name: Display APK after signing
|
||||
shell: bash
|
||||
run: |
|
||||
ls -lh ./apks/
|
||||
du -h -d1 .
|
||||
|
||||
- name: Rename APK after signing
|
||||
shell: bash
|
||||
run: |
|
||||
cd apks
|
||||
rm -fv signingKey.jks
|
||||
rm -fv *.apk.idsig
|
||||
rm -fv *-aligned.apk
|
||||
|
||||
all_apks=$(ls -1 *-signed.apk)
|
||||
echo "----"
|
||||
echo $all_apks
|
||||
echo "----"
|
||||
for apk in ${all_apks[@]}; do
|
||||
n=$(echo $apk | sed -e s/-signed//)
|
||||
mv -v $apk $n
|
||||
done
|
||||
|
||||
cd ..
|
||||
|
||||
ls -lh ./apks/
|
||||
du -h -d1 .
|
||||
|
||||
- name: Display APK after rename
|
||||
shell: bash
|
||||
run: |
|
||||
ls -lh ./apks/
|
||||
du -h -d1 .
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' || github.repository_owner == 'csu-fangjun') && ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') || contains(github.ref, 'refs/tags/'))
|
||||
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
|
||||
export GIT_LFS_SKIP_SMUDGE=1
|
||||
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||
|
||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
||||
|
||||
git clone https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter huggingface
|
||||
cd huggingface
|
||||
git fetch
|
||||
git pull
|
||||
git merge -m "merge remote" --ff origin main
|
||||
|
||||
dst=flutter/asr/android/$SHERPA_ONNX_VERSION
|
||||
mkdir -p $dst
|
||||
|
||||
cp -v ../apks/*.apk $dst
|
||||
|
||||
git status
|
||||
git lfs track "*.apk"
|
||||
git add .
|
||||
git commit -m "add more files"
|
||||
git push https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter main
|
||||
|
||||
tts:
|
||||
if: false
|
||||
name: tts ${{ matrix.index }}/${{ matrix.total }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
total: ["15"]
|
||||
index: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
- name: Check Java version
|
||||
run: |
|
||||
java -version
|
||||
echo $JAVA_HOME
|
||||
|
||||
- name: Set JAVA_HOME for Gradle
|
||||
run: echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
|
||||
|
||||
- name: Check Java version
|
||||
run: |
|
||||
java -version
|
||||
echo $JAVA_HOME
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: Display NDK HOME
|
||||
shell: bash
|
||||
run: |
|
||||
echo "ANDROID_NDK_LATEST_HOME: ${ANDROID_NDK_LATEST_HOME}"
|
||||
ls -lh ${ANDROID_NDK_LATEST_HOME}
|
||||
|
||||
- name: Setup build tool version variable
|
||||
shell: bash
|
||||
run: |
|
||||
echo "---"
|
||||
ls -lh /usr/local/lib/android/
|
||||
echo "---"
|
||||
|
||||
ls -lh /usr/local/lib/android/sdk
|
||||
echo "---"
|
||||
|
||||
ls -lh /usr/local/lib/android/sdk/build-tools
|
||||
echo "---"
|
||||
|
||||
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
|
||||
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV
|
||||
echo "Last build tool version is: $BUILD_TOOL_VERSION"
|
||||
|
||||
- name: Install Python dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install --upgrade jinja2 iso639-lang
|
||||
|
||||
- name: Install deps
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y build-essential jq git cmake
|
||||
sudo apt-get install -y curl
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: 3.29.0
|
||||
cache: true
|
||||
|
||||
- name: Install ninja
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get install -y ninja-build
|
||||
|
||||
- name: Display ninja version
|
||||
shell: bash
|
||||
run: |
|
||||
ninja --version
|
||||
ninja --help || true
|
||||
which ninja
|
||||
|
||||
- name: Display PWD
|
||||
shell: bash
|
||||
run: |
|
||||
echo "pwd: $PWD"
|
||||
ls -lh
|
||||
|
||||
- name: Display machine info
|
||||
shell: bash
|
||||
run: |
|
||||
uname -a
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
|
||||
flutter --version
|
||||
|
||||
git config --global --add safe.directory /__t/flutter-Linux-*/flutter || true
|
||||
|
||||
flutter --version
|
||||
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Install libgtk-3-dev
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt install -y libgtk-3-dev tree clang pkg-config
|
||||
|
||||
- name: Accept Android licenses
|
||||
run: yes | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --licenses
|
||||
|
||||
- name: Install Android SDK Components
|
||||
run: |
|
||||
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager "platforms;android-35" "build-tools;35.0.0"
|
||||
|
||||
- name: Display flutter info (2)
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
cd ..
|
||||
|
||||
- name: Build flutter
|
||||
shell: bash
|
||||
run: |
|
||||
cd scripts/flutter
|
||||
|
||||
total=${{ matrix.total }}
|
||||
index=${{ matrix.index }}
|
||||
|
||||
./generate-tts.py --total $total --index $index
|
||||
|
||||
chmod +x *.sh
|
||||
./build-android-tts.sh
|
||||
|
||||
cd ../../
|
||||
|
||||
ls -lh *.apk
|
||||
|
||||
- name: Display generated files
|
||||
shell: bash
|
||||
run: |
|
||||
ls -lh *.apk
|
||||
|
||||
mkdir apks
|
||||
|
||||
mv -v *.apk ./apks
|
||||
|
||||
# https://github.com/marketplace/actions/sign-android-release
|
||||
- uses: r0adkll/sign-android-release@v1
|
||||
name: Sign app APK
|
||||
with:
|
||||
releaseDirectory: ./apks
|
||||
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }}
|
||||
alias: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }}
|
||||
keyStorePassword: ${{ secrets.ANDROID_SIGNING_KEY_STORE_PASSWORD }}
|
||||
env:
|
||||
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
|
||||
|
||||
- name: Display APK after signing
|
||||
shell: bash
|
||||
run: |
|
||||
ls -lh ./apks/
|
||||
du -h -d1 .
|
||||
|
||||
- name: Rename APK after signing
|
||||
shell: bash
|
||||
run: |
|
||||
cd apks
|
||||
rm -fv signingKey.jks
|
||||
rm -fv *.apk.idsig
|
||||
rm -fv *-aligned.apk
|
||||
|
||||
all_apks=$(ls -1 *-signed.apk)
|
||||
echo "----"
|
||||
echo $all_apks
|
||||
echo "----"
|
||||
for apk in ${all_apks[@]}; do
|
||||
n=$(echo $apk | sed -e s/-signed//)
|
||||
mv -v $apk $n
|
||||
done
|
||||
|
||||
cd ..
|
||||
|
||||
ls -lh ./apks/
|
||||
du -h -d1 .
|
||||
|
||||
- name: Display APK after rename
|
||||
shell: bash
|
||||
run: |
|
||||
ls -lh ./apks/
|
||||
du -h -d1 .
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' || github.repository_owner == 'csu-fangjun') && ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') || contains(github.ref, 'refs/tags/'))
|
||||
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
|
||||
export GIT_LFS_SKIP_SMUDGE=1
|
||||
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||
|
||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
||||
|
||||
git clone https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter huggingface
|
||||
cd huggingface
|
||||
git fetch
|
||||
git pull
|
||||
git merge -m "merge remote" --ff origin main
|
||||
|
||||
dst=flutter/tts/android/$SHERPA_ONNX_VERSION
|
||||
mkdir -p $dst
|
||||
|
||||
cp -v ../apks/*.apk $dst
|
||||
|
||||
git status
|
||||
git lfs track "*.apk"
|
||||
git add .
|
||||
git commit -m "add more files"
|
||||
git push https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter main
|
||||
@@ -1,290 +0,0 @@
|
||||
name: flutter-linux
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- flutter
|
||||
- apk
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: flutter-linux-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# See https://github.com/actions/checkout/issues/1590#issuecomment-2207052044
|
||||
# and
|
||||
# https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
jobs:
|
||||
asr:
|
||||
if: false
|
||||
name: asr ${{ matrix.arch }} ${{ matrix.index }}/${{ matrix.total }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
arch: [x86_64]
|
||||
total: ["3"]
|
||||
index: ["0", "1", "2"]
|
||||
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: Install Python dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install --upgrade jinja2
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: 3.24.3
|
||||
cache: true
|
||||
|
||||
- name: Display PWD
|
||||
shell: bash
|
||||
run: |
|
||||
echo "pwd: $PWD"
|
||||
ls -lh
|
||||
|
||||
- name: Display machine info
|
||||
shell: bash
|
||||
run: |
|
||||
uname -a
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Install libgtk-3-dev
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt install -y libgtk-3-dev tree clang pkg-config
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build flutter
|
||||
shell: bash
|
||||
run: |
|
||||
export arch=${{ matrix.arch }}
|
||||
cd scripts/flutter
|
||||
|
||||
total=${{ matrix.total }}
|
||||
index=${{ matrix.index }}
|
||||
|
||||
./generate-streaming-asr.py --total $total --index $index
|
||||
|
||||
chmod +x *.sh
|
||||
./build-linux-streaming-asr.sh
|
||||
cd ../../
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
- name: Display generated files
|
||||
shell: bash
|
||||
run: |
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' || github.repository_owner == 'csu-fangjun') && ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') || contains(github.ref, 'refs/tags/'))
|
||||
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
|
||||
export GIT_LFS_SKIP_SMUDGE=1
|
||||
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||
|
||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
||||
|
||||
git clone https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter huggingface
|
||||
cd huggingface
|
||||
git fetch
|
||||
git pull
|
||||
git merge -m "merge remote" --ff origin main
|
||||
|
||||
dst=flutter/asr/linux/$SHERPA_ONNX_VERSION
|
||||
mkdir -p $dst
|
||||
|
||||
cp -v ../*.tar.bz2 $dst
|
||||
|
||||
git status
|
||||
git lfs track "*.bz2"
|
||||
git add .
|
||||
git commit -m "add more files"
|
||||
git push https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter main
|
||||
|
||||
tts:
|
||||
if: false
|
||||
name: tts ${{ matrix.arch }} ${{ matrix.index }}/${{ matrix.total }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
arch: [x86_64]
|
||||
total: ["20"]
|
||||
index: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"]
|
||||
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: Install Python dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install --upgrade jinja2
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: 3.24.3
|
||||
cache: true
|
||||
|
||||
- name: Display PWD
|
||||
shell: bash
|
||||
run: |
|
||||
echo "pwd: $PWD"
|
||||
ls -lh
|
||||
|
||||
- name: Display machine info
|
||||
shell: bash
|
||||
run: |
|
||||
uname -a
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Install libgtk-3-dev
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt install -y libgtk-3-dev tree clang pkg-config
|
||||
|
||||
- name: Install deps
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y build-essential jq git python3-pip
|
||||
sudo apt-get install -y curl
|
||||
sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build flutter
|
||||
shell: bash
|
||||
run: |
|
||||
export arch=${{ matrix.arch }}
|
||||
cd scripts/flutter
|
||||
|
||||
total=${{ matrix.total }}
|
||||
index=${{ matrix.index }}
|
||||
|
||||
./generate-tts.py --total $total --index $index
|
||||
|
||||
chmod +x *.sh
|
||||
./build-linux-tts.sh
|
||||
cd ../../
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
- name: Display generated files
|
||||
shell: bash
|
||||
run: |
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' || github.repository_owner == 'csu-fangjun') && ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') || contains(github.ref, 'refs/tags/'))
|
||||
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
|
||||
export GIT_LFS_SKIP_SMUDGE=1
|
||||
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||
|
||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
||||
|
||||
git clone https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter huggingface
|
||||
cd huggingface
|
||||
git fetch
|
||||
git pull
|
||||
git merge -m "merge remote" --ff origin main
|
||||
|
||||
dst=flutter/tts/linux/$SHERPA_ONNX_VERSION
|
||||
mkdir -p $dst
|
||||
|
||||
cp -v ../*.tar.bz2 $dst
|
||||
|
||||
git status
|
||||
git lfs track "*.bz2"
|
||||
git add .
|
||||
git commit -m "add more files"
|
||||
git push https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter main
|
||||
@@ -1,242 +0,0 @@
|
||||
name: flutter-macos
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- flutter
|
||||
- apk
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: flutter-macos-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
asr:
|
||||
if: false
|
||||
name: asr ${{ matrix.arch }}/${{ matrix.total }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest]
|
||||
arch: [x86_64, arm64]
|
||||
total: ["3"]
|
||||
index: ["0", "1", "2"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: Install Python dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install --break-system-packages --upgrade jinja2
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: 3.24.3
|
||||
cache: true
|
||||
|
||||
- name: Display PWD
|
||||
shell: bash
|
||||
run: |
|
||||
echo "pwd: $PWD"
|
||||
ls -lh
|
||||
|
||||
- name: Display machine info
|
||||
shell: bash
|
||||
run: |
|
||||
uname -a
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build flutter
|
||||
shell: bash
|
||||
run: |
|
||||
export arch=${{ matrix.arch }}
|
||||
cd scripts/flutter
|
||||
|
||||
total=${{ matrix.total }}
|
||||
index=${{ matrix.index }}
|
||||
|
||||
./generate-streaming-asr.py --total $total --index $index
|
||||
|
||||
chmod +x *.sh
|
||||
./build-macos-streaming-asr.sh
|
||||
cd ../../
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
- name: Display generated files
|
||||
shell: bash
|
||||
run: |
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' || github.repository_owner == 'csu-fangjun') && ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') || contains(github.ref, 'refs/tags/'))
|
||||
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
|
||||
export GIT_LFS_SKIP_SMUDGE=1
|
||||
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||
|
||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
||||
|
||||
git clone https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter huggingface
|
||||
cd huggingface
|
||||
git fetch
|
||||
git pull
|
||||
git merge -m "merge remote" --ff origin main
|
||||
|
||||
dst=flutter/asr/macos/$SHERPA_ONNX_VERSION
|
||||
mkdir -p $dst
|
||||
|
||||
cp -v ../*.tar.bz2 $dst
|
||||
|
||||
git status
|
||||
git lfs track "*.bz2"
|
||||
git add .
|
||||
git commit -m "add more files"
|
||||
git push https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter main
|
||||
|
||||
tts:
|
||||
if: false
|
||||
name: tts ${{ matrix.arch }} ${{ matrix.index }}/${{ matrix.total }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest]
|
||||
arch: [x86_64, arm64]
|
||||
total: ["10"]
|
||||
index: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: Install Python dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install --break-system-packages --upgrade jinja2 iso639-lang
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: 3.24.3
|
||||
cache: true
|
||||
|
||||
- name: Display PWD
|
||||
shell: bash
|
||||
run: |
|
||||
echo "pwd: $PWD"
|
||||
ls -lh
|
||||
|
||||
- name: Display machine info
|
||||
shell: bash
|
||||
run: |
|
||||
uname -a
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build flutter
|
||||
shell: bash
|
||||
run: |
|
||||
export arch=${{ matrix.arch }}
|
||||
cd scripts/flutter
|
||||
|
||||
total=${{ matrix.total }}
|
||||
index=${{ matrix.index }}
|
||||
|
||||
./generate-tts.py --total $total --index $index
|
||||
|
||||
chmod +x *.sh
|
||||
./build-macos-tts.sh
|
||||
cd ../../
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
- name: Display generated files
|
||||
shell: bash
|
||||
run: |
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' || github.repository_owner == 'csu-fangjun') && ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') || contains(github.ref, 'refs/tags/'))
|
||||
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
|
||||
export GIT_LFS_SKIP_SMUDGE=1
|
||||
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||
|
||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
||||
|
||||
git clone https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter huggingface
|
||||
cd huggingface
|
||||
git fetch
|
||||
git pull
|
||||
git merge -m "merge remote" --ff origin main
|
||||
dst=flutter/tts/macos/$SHERPA_ONNX_VERSION
|
||||
mkdir -p $dst
|
||||
cp -v ../*.tar.bz2 $dst
|
||||
|
||||
git status
|
||||
git lfs track "*.bz2"
|
||||
git add .
|
||||
git commit -m "add more files"
|
||||
git push https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter main
|
||||
@@ -1,227 +0,0 @@
|
||||
name: flutter-windows-x64
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- flutter
|
||||
- apk
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: flutter-windows-x64-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
asr:
|
||||
if: false
|
||||
name: asr ${{ matrix.index }}/${{ matrix.total }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-2022]
|
||||
total: ["3"]
|
||||
index: ["0", "1", "2"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: Install Python dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install --upgrade jinja2
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: 3.24.3
|
||||
cache: true
|
||||
|
||||
- name: Display PWD
|
||||
shell: bash
|
||||
run: |
|
||||
echo "pwd: $PWD"
|
||||
ls -lh
|
||||
|
||||
- name: Display machine info
|
||||
shell: bash
|
||||
run: |
|
||||
uname -a
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build flutter
|
||||
shell: bash
|
||||
run: |
|
||||
cd scripts/flutter
|
||||
|
||||
total=${{ matrix.total }}
|
||||
index=${{ matrix.index }}
|
||||
|
||||
./generate-streaming-asr.py --total $total --index $index
|
||||
|
||||
chmod +x *.sh
|
||||
./build-windows-streaming-asr.sh
|
||||
cd ../../
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' || github.repository_owner == 'csu-fangjun') && ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') || contains(github.ref, 'refs/tags/'))
|
||||
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
|
||||
export GIT_LFS_SKIP_SMUDGE=1
|
||||
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||
|
||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
||||
|
||||
git clone https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter huggingface
|
||||
cd huggingface
|
||||
git fetch
|
||||
git pull
|
||||
git merge -m "merge remote" --ff origin main
|
||||
|
||||
dst=flutter/asr/windows/$SHERPA_ONNX_VERSION
|
||||
mkdir -p $dst
|
||||
cp -v ../*.tar.bz2 $dst
|
||||
|
||||
git status
|
||||
git lfs track "*.bz2"
|
||||
git add .
|
||||
git commit -m "add more files"
|
||||
git push https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter main
|
||||
|
||||
tts:
|
||||
if: false
|
||||
name: tts ${{ matrix.index }}/${{ matrix.total }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-2022]
|
||||
total: ["20"]
|
||||
index: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "11", "12", "13", "14", "15", "16", "17", "18", "19"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: Install Python dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install --upgrade jinja2 iso639-lang
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v3
|
||||
with:
|
||||
channel: stable
|
||||
version: latest
|
||||
|
||||
- name: Display PWD
|
||||
shell: bash
|
||||
run: |
|
||||
echo "pwd: $PWD"
|
||||
ls -lh
|
||||
|
||||
- name: Display machine info
|
||||
shell: bash
|
||||
run: |
|
||||
uname -a
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build flutter
|
||||
shell: bash
|
||||
run: |
|
||||
cd scripts/flutter
|
||||
|
||||
total=${{ matrix.total }}
|
||||
index=${{ matrix.index }}
|
||||
|
||||
./generate-tts.py --total $total --index $index
|
||||
|
||||
chmod +x *.sh
|
||||
./build-windows-tts.sh
|
||||
cd ../../
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' || github.repository_owner == 'csu-fangjun') && ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') || contains(github.ref, 'refs/tags/'))
|
||||
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
|
||||
export GIT_LFS_SKIP_SMUDGE=1
|
||||
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||
|
||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
||||
|
||||
git clone https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter huggingface
|
||||
cd huggingface
|
||||
git fetch
|
||||
git pull
|
||||
git merge -m "merge remote" --ff origin main
|
||||
|
||||
dst=flutter/tts/windows/$SHERPA_ONNX_VERSION
|
||||
mkdir -p $dst
|
||||
cp -v ../*.tar.bz2 $dst
|
||||
|
||||
git status
|
||||
git lfs track "*.bz2"
|
||||
git add .
|
||||
git commit -m "add more files"
|
||||
git push https://csukuangfj2:$HF_TOKEN@huggingface.co/csukuangfj2/sherpa-onnx-flutter main
|
||||
@@ -182,7 +182,7 @@ jobs:
|
||||
file: ./*.har
|
||||
# repo_name: k2-fsa/sherpa-onnx
|
||||
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
# tag: v1.12.30
|
||||
# tag: v1.13.8
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
|
||||
|
||||
@@ -162,4 +162,4 @@ jobs:
|
||||
file: ./*.tar.bz2
|
||||
# repo_name: k2-fsa/sherpa-onnx
|
||||
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
# tag: v1.10.23
|
||||
# tag: v1.13.8
|
||||
+71
-27
@@ -39,9 +39,7 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
find ios-swiftui ios-swift -name "project.pbxproj" -exec sed -i '' \
|
||||
-e 's|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|' \
|
||||
-e 's|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|' \
|
||||
-e '/requirement = {/,/};/d' \
|
||||
-e '/\/\* XCRemoteSwiftPackageReference "sherpa-onnx" \*\/ = {/,/^\t\t};/{s|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|;s|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|;/requirement = {/,/};/d;}' \
|
||||
{} +
|
||||
git diff
|
||||
cat ios-swiftui/SherpaOnnxAsr/SherpaOnnxAsr.xcodeproj/project.pbxproj
|
||||
@@ -97,9 +95,7 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
find ios-swiftui ios-swift -name "project.pbxproj" -exec sed -i '' \
|
||||
-e 's|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|' \
|
||||
-e 's|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|' \
|
||||
-e '/requirement = {/,/};/d' \
|
||||
-e '/\/\* XCRemoteSwiftPackageReference "sherpa-onnx" \*\/ = {/,/^\t\t};/{s|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|;s|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|;/requirement = {/,/};/d;}' \
|
||||
{} +
|
||||
git diff
|
||||
cat ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass.xcodeproj/project.pbxproj
|
||||
@@ -155,9 +151,7 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
find ios-swiftui ios-swift -name "project.pbxproj" -exec sed -i '' \
|
||||
-e 's|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|' \
|
||||
-e 's|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|' \
|
||||
-e '/requirement = {/,/};/d' \
|
||||
-e '/\/\* XCRemoteSwiftPackageReference "sherpa-onnx" \*\/ = {/,/^\t\t};/{s|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|;s|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|;/requirement = {/,/};/d;}' \
|
||||
{} +
|
||||
git diff
|
||||
cat ios-swiftui/SherpaOnnxLangID/SherpaOnnxLangID.xcodeproj/project.pbxproj
|
||||
@@ -213,9 +207,7 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
find ios-swiftui ios-swift -name "project.pbxproj" -exec sed -i '' \
|
||||
-e 's|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|' \
|
||||
-e 's|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|' \
|
||||
-e '/requirement = {/,/};/d' \
|
||||
-e '/\/\* XCRemoteSwiftPackageReference "sherpa-onnx" \*\/ = {/,/^\t\t};/{s|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|;s|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|;/requirement = {/,/};/d;}' \
|
||||
{} +
|
||||
git diff
|
||||
cat ios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle.xcodeproj/project.pbxproj
|
||||
@@ -271,20 +263,18 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
find ios-swiftui ios-swift -name "project.pbxproj" -exec sed -i '' \
|
||||
-e 's|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|' \
|
||||
-e 's|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|' \
|
||||
-e '/requirement = {/,/};/d' \
|
||||
-e '/\/\* XCRemoteSwiftPackageReference "sherpa-onnx" \*\/ = {/,/^\t\t};/{s|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|;s|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|;/requirement = {/,/};/d;}' \
|
||||
{} +
|
||||
git diff
|
||||
cat ios-swiftui/SherpaOnnxTts/SherpaOnnxTts.xcodeproj/project.pbxproj
|
||||
cat ios-swiftui/SherpaOnnxTtsLexicon/SherpaOnnxTtsLexicon.xcodeproj/project.pbxproj
|
||||
|
||||
- name: Build SherpaOnnxTts (local)
|
||||
- name: Build SherpaOnnxTtsLexicon (local)
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd ios-swiftui/SherpaOnnxTts
|
||||
xcodebuild -project SherpaOnnxTts.xcodeproj \
|
||||
-scheme SherpaOnnxTts \
|
||||
cd ios-swiftui/SherpaOnnxTtsLexicon
|
||||
xcodebuild -project SherpaOnnxTtsLexicon.xcodeproj \
|
||||
-scheme SherpaOnnxTtsLexicon \
|
||||
-destination 'generic/platform=iOS Simulator' \
|
||||
-skipPackagePluginValidation \
|
||||
build
|
||||
@@ -301,13 +291,69 @@ jobs:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Build SherpaOnnxTts
|
||||
- name: Build SherpaOnnxTtsLexicon
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd ios-swiftui/SherpaOnnxTts
|
||||
xcodebuild -project SherpaOnnxTts.xcodeproj \
|
||||
-scheme SherpaOnnxTts \
|
||||
cd ios-swiftui/SherpaOnnxTtsLexicon
|
||||
xcodebuild -project SherpaOnnxTtsLexicon.xcodeproj \
|
||||
-scheme SherpaOnnxTtsLexicon \
|
||||
-destination 'generic/platform=iOS Simulator' \
|
||||
-skipPackagePluginValidation \
|
||||
build
|
||||
|
||||
sherpa-onnx-tts-phonemize-local:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, macos-15-intel]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Patch to local package
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
find ios-swiftui ios-swift -name "project.pbxproj" -exec sed -i '' \
|
||||
-e '/\/\* XCRemoteSwiftPackageReference "sherpa-onnx" \*\/ = {/,/^\t\t};/{s|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|;s|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|;/requirement = {/,/};/d;}' \
|
||||
{} +
|
||||
git diff
|
||||
cat ios-swiftui/SherpaOnnxTtsPhonemize/SherpaOnnxTtsPhonemize.xcodeproj/project.pbxproj
|
||||
|
||||
- name: Build SherpaOnnxTtsPhonemize (local)
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd ios-swiftui/SherpaOnnxTtsPhonemize
|
||||
xcodebuild -project SherpaOnnxTtsPhonemize.xcodeproj \
|
||||
-scheme SherpaOnnxTtsPhonemize \
|
||||
-destination 'generic/platform=iOS Simulator' \
|
||||
-skipPackagePluginValidation \
|
||||
build
|
||||
|
||||
sherpa-onnx-tts-phonemize:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, macos-15-intel]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Build SherpaOnnxTtsPhonemize
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd ios-swiftui/SherpaOnnxTtsPhonemize
|
||||
xcodebuild -project SherpaOnnxTtsPhonemize.xcodeproj \
|
||||
-scheme SherpaOnnxTtsPhonemize \
|
||||
-destination 'generic/platform=iOS Simulator' \
|
||||
-skipPackagePluginValidation \
|
||||
build
|
||||
@@ -329,9 +375,7 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
find ios-swiftui ios-swift -name "project.pbxproj" -exec sed -i '' \
|
||||
-e 's|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|' \
|
||||
-e 's|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|' \
|
||||
-e '/requirement = {/,/};/d' \
|
||||
-e '/\/\* XCRemoteSwiftPackageReference "sherpa-onnx" \*\/ = {/,/^\t\t};/{s|isa = XCRemoteSwiftPackageReference|isa = XCLocalSwiftPackageReference|;s|repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"|relativePath = ../../|;/requirement = {/,/};/d;}' \
|
||||
{} +
|
||||
git diff
|
||||
cat ios-swift/SherpaOnnxAsr/SherpaOnnxAsr.xcodeproj/project.pbxproj
|
||||
|
||||
@@ -315,6 +315,8 @@ jobs:
|
||||
tar xf kitten-nano-en-v0_1-fp16.tar.bz2
|
||||
rm kitten-nano-en-v0_1-fp16.tar.bz2
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
java \
|
||||
-cp "../sherpa-onnx/java-api/target/sherpa-onnx-jvm-$SHERPA_ONNX_VERSION.jar${SEP}../sherpa-onnx/java-api/$native_jar" \
|
||||
NonStreamingTtsKittenEn.java
|
||||
NonStreamingTtsKittenEnLexicon.java
|
||||
@@ -136,10 +136,6 @@ jobs:
|
||||
file build/bin/sherpa-onnx
|
||||
ls -lh build/bin/sherpa-onnx
|
||||
readelf -d build/bin/sherpa-onnx
|
||||
|
||||
rm -fv build/install/include/cargs.h
|
||||
rm -fv build/install/lib/cargs.h
|
||||
rm -fv build/install/lib/libcargs.so
|
||||
rm -rfv build/install/lib/pkgconfig
|
||||
|
||||
strings build/install/lib/*.so | grep "^GLIBC_"
|
||||
|
||||
@@ -103,9 +103,6 @@ jobs:
|
||||
ls -lh lib
|
||||
rm -rf ./install/lib/pkgconfig
|
||||
rm -rf ./install/lib/share
|
||||
rm -rf ./install/lib/cargs.h
|
||||
rm -rf ./install/include/cargs.h
|
||||
rm -rf ./install/lib/libcargs.so
|
||||
rm -rf ./install/lib/libsherpa-onnx-c-api.so
|
||||
|
||||
echo "----"
|
||||
|
||||
@@ -137,9 +137,6 @@ jobs:
|
||||
ls -lh bin
|
||||
rm -rf ./install/lib/pkgconfig
|
||||
rm -rf ./install/lib/share
|
||||
rm -rf ./install/lib/cargs.h
|
||||
rm -rf ./install/include/cargs.h
|
||||
rm -rf ./install/lib/libcargs.so
|
||||
rm -rf ./install/lib/libsherpa-onnx-c-api.so
|
||||
rm -rf ./install/lib/libsherpa-onnx-cxx-api.so
|
||||
|
||||
|
||||
@@ -184,10 +184,6 @@ jobs:
|
||||
file build/bin/sherpa-onnx
|
||||
ls -lh build/bin/sherpa-onnx
|
||||
readelf -d build/bin/sherpa-onnx
|
||||
|
||||
rm -fv build/install/include/cargs.h
|
||||
rm -fv build/install/lib/cargs.h
|
||||
rm -fv build/install/lib/libcargs.so
|
||||
rm -rfv build/install/lib/pkgconfig
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
@@ -230,10 +226,8 @@ jobs:
|
||||
mkdir -p ${lib_dst}/lib
|
||||
if [[ ${{ matrix.shared_lib }} == ON ]]; then
|
||||
cp -av build/install/lib/lib*.so* ${lib_dst}/lib/
|
||||
rm -f ${lib_dst}/lib/libcargs.so ${lib_dst}/lib/libcargs.so.*
|
||||
else
|
||||
cp -av build/install/lib/lib*.a ${lib_dst}/lib/
|
||||
rm -f ${lib_dst}/lib/libcargs.a
|
||||
fi
|
||||
tree ${lib_dst}
|
||||
tar cjvf ${lib_dst}.tar.bz2 ${lib_dst}
|
||||
@@ -249,7 +243,7 @@ jobs:
|
||||
file: sherpa-onnx-*.tar.bz2
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: v1.12.31
|
||||
tag: v1.13.8
|
||||
|
||||
- name: Release pre-compiled binaries and libs for linux x64
|
||||
if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') && matrix.build_type == 'Release'
|
||||
|
||||
@@ -79,9 +79,6 @@ jobs:
|
||||
|
||||
rm -rf ./install/lib/pkgconfig
|
||||
rm -rf ./install/lib/share
|
||||
rm -rf ./install/lib/cargs.h
|
||||
rm -rf ./install/include/cargs.h
|
||||
rm -rf ./install/lib/libcargs.dylib
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
||||
@@ -126,11 +126,6 @@ jobs:
|
||||
ls -lh bin
|
||||
|
||||
file ./bin/sherpa-onnx
|
||||
|
||||
rm -fv ./install/include/cargs.h
|
||||
rm -fv ./install/lib/cargs.h
|
||||
rm -fv ./install/lib/libcargs.dylib
|
||||
rm -fv ./install/lib/libcargs.a
|
||||
rm -rfv ./install/lib/pkgconfig
|
||||
|
||||
- name: Display dependencies of sherpa-onnx for macos
|
||||
@@ -198,10 +193,8 @@ jobs:
|
||||
mkdir -p ${lib_dst}/lib
|
||||
if [[ ${{ matrix.lib_type }} == shared ]]; then
|
||||
cp -av build/install/lib/lib*.dylib* ${lib_dst}/lib/
|
||||
rm -f ${lib_dst}/lib/libcargs.dylib ${lib_dst}/lib/libcargs*.dylib
|
||||
else
|
||||
cp -av build/install/lib/lib*.a ${lib_dst}/lib/
|
||||
rm -f ${lib_dst}/lib/libcargs.a
|
||||
fi
|
||||
tree ${lib_dst}
|
||||
sign_macos_tree "$lib_dst"
|
||||
@@ -236,7 +229,7 @@ jobs:
|
||||
file: sherpa-onnx-*.tar.bz2
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: v1.12.31
|
||||
tag: v1.13.8
|
||||
|
||||
- name: Release pre-compiled binaries and libs for macOS
|
||||
if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') && matrix.build_type == 'Release'
|
||||
|
||||
@@ -127,7 +127,7 @@ jobs:
|
||||
file: ./mfc-examples/${{ matrix.arch }}/Release/sherpa-onnx-streaming-*.exe
|
||||
# repo_name: k2-fsa/sherpa-onnx
|
||||
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
# tag: v1.12.32
|
||||
# tag: v1.13.8
|
||||
|
||||
- name: Release pre-compiled binaries and libs for Windows ${{ matrix.arch }}
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||
@@ -138,7 +138,7 @@ jobs:
|
||||
file: ./mfc-examples/${{ matrix.arch }}/Release/sherpa-onnx-non-streaming-*.exe
|
||||
# repo_name: k2-fsa/sherpa-onnx
|
||||
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
# tag: v1.12.32
|
||||
# tag: v1.13.8
|
||||
|
||||
- name: Release pre-compiled binaries and libs for Windows ${{ matrix.arch }}
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||
@@ -149,4 +149,4 @@ jobs:
|
||||
file: ./mfc-examples/${{ matrix.arch }}/sherpa-onnx-non-streaming-*.exe
|
||||
# repo_name: k2-fsa/sherpa-onnx
|
||||
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
# tag: v1.12.32
|
||||
# tag: v1.13.8
|
||||
@@ -1,15 +1,6 @@
|
||||
name: nightly-wheel-arm
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# minute (0-59)
|
||||
# hour (0-23)
|
||||
# day of the month (1-31)
|
||||
# month (1-12)
|
||||
# day of the week (0-6)
|
||||
# nightly build at 23:50 UTC time every day
|
||||
- cron: "50 23 * * *"
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
|
||||
@@ -61,7 +61,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF \
|
||||
..
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF \
|
||||
..
|
||||
|
||||
|
||||
@@ -152,6 +152,9 @@ jobs:
|
||||
./run-cohere-transcribe.sh
|
||||
rm -rf sherpa-onnx-cohere-transcribe-*
|
||||
echo "---"
|
||||
./run-zipformer-ctc-hlg.sh
|
||||
rm -rf sherpa-onnx-zipformer-ctc-*
|
||||
echo "---"
|
||||
popd
|
||||
|
||||
- name: Run Speech Enhancement test
|
||||
@@ -190,6 +193,7 @@ jobs:
|
||||
|
||||
./run-piper.sh
|
||||
rm -rf vits-piper-*
|
||||
rm -f lexicon-en-us.txt
|
||||
rm piper
|
||||
ls -lh
|
||||
echo "---"
|
||||
@@ -202,6 +206,7 @@ jobs:
|
||||
|
||||
./run-kokoro-en.sh
|
||||
rm -rf kokoro-en-*
|
||||
rm -f lexicon-en-us.txt
|
||||
rm kokoro-en
|
||||
ls -lh
|
||||
echo "---"
|
||||
@@ -214,6 +219,7 @@ jobs:
|
||||
|
||||
./run-matcha-en.sh
|
||||
rm -rf matcha-icefall-*
|
||||
rm -f lexicon-en-us.txt
|
||||
rm matcha-en
|
||||
ls -lh
|
||||
echo "---"
|
||||
@@ -227,6 +233,7 @@ jobs:
|
||||
./run-zipvoice-zh-en.sh
|
||||
rm -rf sherpa-onnx-zipvoice-*
|
||||
rm -f vocos_24khz.onnx
|
||||
rm -f lexicon-en-us.txt
|
||||
rm zipvoice-zh-en
|
||||
ls -lh
|
||||
echo "---"
|
||||
|
||||
@@ -106,8 +106,6 @@ jobs:
|
||||
|
||||
gcc -o decode-file-c-api $(pkg-config --cflags sherpa-onnx) ./decode-file-c-api.c $(pkg-config --libs sherpa-onnx)
|
||||
|
||||
./decode-file-c-api --help
|
||||
|
||||
- name: Build C API example (tts)
|
||||
if: matrix.tts == 'ON'
|
||||
shell: bash
|
||||
@@ -119,7 +117,15 @@ jobs:
|
||||
|
||||
gcc -o offline-tts-c-api $(pkg-config --cflags sherpa-onnx) ./offline-tts-c-api.c $(pkg-config --libs sherpa-onnx)
|
||||
|
||||
./offline-tts-c-api --help
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-ljs.tar.bz2
|
||||
tar xf vits-ljs.tar.bz2
|
||||
rm vits-ljs.tar.bz2
|
||||
|
||||
./offline-tts-c-api
|
||||
|
||||
mkdir -p ../tts
|
||||
mv generated-offline-tts-c.wav ../tts/
|
||||
rm -rf vits-ljs
|
||||
|
||||
- name: Test online transducer (C API)
|
||||
shell: bash
|
||||
|
||||
@@ -464,7 +464,6 @@ jobs:
|
||||
-D CMAKE_INSTALL_PREFIX=./install \
|
||||
-D SHERPA_ONNX_ENABLE_JNI=OFF \
|
||||
-D SHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-D BUILD_ESPEAK_NG_EXE=OFF \
|
||||
..
|
||||
|
||||
- name: Build sherpa-onnx
|
||||
|
||||
@@ -214,7 +214,7 @@ jobs:
|
||||
file: sherpa-onnx-*linux-riscv64*.tar.bz2
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: v1.12.11
|
||||
tag: v1.13.8
|
||||
|
||||
- name: Release pre-compiled binaries and libs for riscv64 linux ${{ matrix.lib_type }}
|
||||
if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||
@@ -277,10 +277,11 @@ jobs:
|
||||
|
||||
source .github/scripts/common.sh
|
||||
download_and_extract https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-lessac-medium.tar.bz2
|
||||
download https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
qemu-riscv64 ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline-tts \
|
||||
--vits-model=./vits-piper-en_US-lessac-medium/en_US-lessac-medium.onnx \
|
||||
--vits-data-dir=./vits-piper-en_US-lessac-medium/espeak-ng-data \
|
||||
--vits-lexicon=./lexicon-en-us.txt \
|
||||
--vits-tokens=./vits-piper-en_US-lessac-medium/tokens.txt \
|
||||
--output-filename=./liliana-piper-en_US-lessac-medium.wav \
|
||||
'liliana, the most beautiful and lovely assistant of our team!'
|
||||
|
||||
@@ -218,7 +218,7 @@ jobs:
|
||||
file: sherpa-onnx-*linux-riscv64*.tar.bz2
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: v1.12.11
|
||||
tag: v1.13.8
|
||||
|
||||
- name: Release pre-compiled binaries and libs for riscv64 linux ${{ matrix.lib_type }}
|
||||
if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||
@@ -288,10 +288,12 @@ jobs:
|
||||
tar xf vits-piper-en_US-lessac-medium.tar.bz2
|
||||
rm vits-piper-en_US-lessac-medium.tar.bz2
|
||||
|
||||
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/lexicon-en-us.txt
|
||||
|
||||
qemu-riscv64 ${QEMU_ARGS} ./build-riscv64-linux-gnu-spacemit/bin/sherpa-onnx-offline-tts \
|
||||
--provider=spacemit \
|
||||
--vits-model=./vits-piper-en_US-lessac-medium/en_US-lessac-medium.onnx \
|
||||
--vits-data-dir=./vits-piper-en_US-lessac-medium/espeak-ng-data \
|
||||
--vits-lexicon=./lexicon-en-us.txt \
|
||||
--vits-tokens=./vits-piper-en_US-lessac-medium/tokens.txt \
|
||||
--output-filename=./liliana-piper-en_US-lessac-medium.wav \
|
||||
'liliana, the most beautiful and lovely assistant of our team!'
|
||||
|
||||
@@ -125,8 +125,6 @@ jobs:
|
||||
make -j4 install
|
||||
|
||||
rm -rf install/lib/pkgconfig
|
||||
rm -fv install/lib/cargs.h
|
||||
rm -fv install/lib/libcargs.so
|
||||
'
|
||||
|
||||
- name: Display system info
|
||||
@@ -253,7 +251,7 @@ jobs:
|
||||
file: sherpa-onnx-*linux-aarch64*.tar.bz2
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: v1.12.13
|
||||
tag: v1.13.8
|
||||
|
||||
- name: Test offline Moonshine
|
||||
if: matrix.build_type != 'Debug' && !startsWith(github.ref, 'refs/tags/')
|
||||
|
||||
@@ -129,7 +129,6 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_JNI=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
@@ -154,6 +153,63 @@ jobs:
|
||||
cd ./java-api-examples
|
||||
./run-version-test.sh
|
||||
|
||||
- name: Run java test (Non-Streaming TTS)
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./java-api-examples
|
||||
|
||||
./run-pocket-tts.sh
|
||||
./run-zipvoice-tts-lexicon.sh
|
||||
./run-supertonic-tts.sh
|
||||
./run-non-streaming-tts-kitten-en-lexicon.sh
|
||||
./run-non-streaming-tts-kokoro-zh-en-lexicon.sh
|
||||
./run-non-streaming-tts-kokoro-en-lexicon.sh
|
||||
./run-non-streaming-tts-matcha-zh-lexicon.sh
|
||||
./run-non-streaming-tts-matcha-en-lexicon.sh
|
||||
ls -lh
|
||||
|
||||
rm -rf sherpa-onnx-pocket-tts-*
|
||||
rm -rf sherpa-onnx-zipvoice-distill-int8-zh-en-emilia
|
||||
rm -rf sherpa-onnx-supertonic-*
|
||||
rm -rf kitten-nano-en-*
|
||||
rm -rf kokoro-multi-*
|
||||
rm -rf kokoro-en-*
|
||||
|
||||
rm -rf matcha-icefall-*
|
||||
rm vocos-22khz-univ.onnx
|
||||
rm vocos_24khz.onnx
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
./run-non-streaming-tts-piper-en-lexicon.sh
|
||||
./run-non-streaming-tts-piper-en-with-callback-lexicon.sh
|
||||
rm -rf vits-piper-*
|
||||
rm -f lexicon-en-us.txt
|
||||
|
||||
./run-non-streaming-tts-coqui-de.sh
|
||||
rm -rf vits-coqui-*
|
||||
|
||||
./run-non-streaming-tts-vits-zh-lexicon.sh
|
||||
rm -rf vits-zh-*
|
||||
|
||||
./run-non-streaming-tts-piper-en-phonemize.sh
|
||||
./run-non-streaming-tts-piper-en-with-callback-phonemize.sh
|
||||
./run-non-streaming-tts-kitten-en-phonemize.sh
|
||||
./run-non-streaming-tts-kokoro-en-phonemize.sh
|
||||
./run-non-streaming-tts-matcha-en-phonemize.sh
|
||||
./run-non-streaming-tts-vits-de-phonemize.sh
|
||||
ls -lh
|
||||
|
||||
rm -rf vits-piper-* kitten-nano-en-* kokoro-en-* matcha-icefall-*
|
||||
rm -f vocos-22khz-univ.onnx
|
||||
rm -f piper-phonemize-*.jar
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tts-wav-files-${{ matrix.os }}
|
||||
path: |
|
||||
java-api-examples/tts-*.wav
|
||||
java-api-examples/generated-*.wav
|
||||
|
||||
- name: Run java test (speaker diarization)
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -187,6 +243,9 @@ jobs:
|
||||
./run-non-streaming-decode-file-zipformer-ctc.sh
|
||||
rm -rf sherpa-onnx-zipformer-ctc-*
|
||||
|
||||
./run-non-streaming-zipformer-ctc-hlg.sh
|
||||
rm -rf sherpa-onnx-zipformer-ctc-*
|
||||
|
||||
./run-non-streaming-decode-file-dolphin-ctc.sh
|
||||
rm -rf sherpa-onnx-dolphin-*
|
||||
|
||||
@@ -406,46 +465,6 @@ jobs:
|
||||
./run-streaming-decode-file-transducer.sh
|
||||
rm -rf sherpa-onnx-streaming-*
|
||||
|
||||
- name: Run java test (Non-Streaming TTS)
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./java-api-examples
|
||||
|
||||
./run-pocket-tts.sh
|
||||
./run-zipvoice-tts.sh
|
||||
./run-supertonic-tts.sh
|
||||
./run-non-streaming-tts-kitten-en.sh
|
||||
./run-non-streaming-tts-kokoro-zh-en.sh
|
||||
./run-non-streaming-tts-kokoro-en.sh
|
||||
./run-non-streaming-tts-matcha-zh.sh
|
||||
./run-non-streaming-tts-matcha-en.sh
|
||||
ls -lh
|
||||
|
||||
rm -rf sherpa-onnx-pocket-tts-*
|
||||
rm -rf sherpa-onnx-zipvoice-distill-int8-zh-en-emilia
|
||||
rm -rf sherpa-onnx-supertonic-*
|
||||
rm -rf kitten-nano-en-*
|
||||
rm -rf kokoro-multi-*
|
||||
rm -rf kokoro-en-*
|
||||
|
||||
rm -rf matcha-icefall-*
|
||||
rm vocos-22khz-univ.onnx
|
||||
rm vocos_24khz.onnx
|
||||
|
||||
./run-non-streaming-tts-piper-en.sh
|
||||
rm -rf vits-piper-*
|
||||
|
||||
./run-non-streaming-tts-coqui-de.sh
|
||||
rm -rf vits-coqui-*
|
||||
|
||||
./run-non-streaming-tts-vits-zh.sh
|
||||
rm -rf vits-zh-*
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tts-wav-files-${{ matrix.os }}
|
||||
path: java-api-examples/*.wav
|
||||
|
||||
run_maven_test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: maven-${{ matrix.os }} ${{ matrix.arch }}
|
||||
|
||||
@@ -9,6 +9,7 @@ on:
|
||||
paths:
|
||||
- '.github/workflows/run-python-test.yaml'
|
||||
- '.github/scripts/test-python.sh'
|
||||
- '.github/scripts/test-python-tts-frontends.sh'
|
||||
- '.github/scripts/test-speaker-recognition-python.sh'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
@@ -19,6 +20,7 @@ on:
|
||||
paths:
|
||||
- '.github/workflows/run-python-test.yaml'
|
||||
- '.github/scripts/test-python.sh'
|
||||
- '.github/scripts/test-python-tts-frontends.sh'
|
||||
- '.github/scripts/test-speaker-recognition-python.sh'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
@@ -158,8 +160,13 @@ jobs:
|
||||
- name: Install Python dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip numpy pypinyin soundfile
|
||||
python3 -m pip install --upgrade pip numpy pypinyin soundfile
|
||||
python3 -m pip install wheel twine setuptools
|
||||
# External phonemizers used by the test-offline-tts-*-phonemize.py
|
||||
# examples. piper_phonemize ships espeak-ng inside the wheel; it is
|
||||
# a pip dependency, not a build dependency of sherpa-onnx.
|
||||
python3 -m pip install --upgrade 'misaki[zh]' kaldifst
|
||||
python3 -m pip install --upgrade piper_phonemize -f https://k2-fsa.github.io/icefall/piper_phonemize.html
|
||||
|
||||
- name: Install librosa (Linux/macOS)
|
||||
if: runner.os != 'Windows'
|
||||
@@ -301,6 +308,7 @@ jobs:
|
||||
echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
|
||||
|
||||
.github/scripts/test-python.sh
|
||||
.github/scripts/test-python-tts-frontends.sh
|
||||
.github/scripts/test-speaker-recognition-python.sh
|
||||
|
||||
- name: Test sherpa-onnx (macOS/Windows)
|
||||
@@ -309,6 +317,7 @@ jobs:
|
||||
run: |
|
||||
export OS=${{ matrix.os }}
|
||||
.github/scripts/test-python.sh
|
||||
.github/scripts/test-python-tts-frontends.sh
|
||||
.github/scripts/test-speaker-recognition-python.sh
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
|
||||
@@ -3,15 +3,6 @@ name: sanitizer
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
schedule:
|
||||
# minute (0-59)
|
||||
# hour (0-23)
|
||||
# day of the month (1-31)
|
||||
# month (1-12)
|
||||
# day of the week (0-6)
|
||||
# nightly build at 22:50 UTC time every day
|
||||
- cron: "50 22 * * *"
|
||||
|
||||
concurrency:
|
||||
group: sanitizer-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
@@ -54,6 +45,7 @@ jobs:
|
||||
|
||||
cmake \
|
||||
-DSHERPA_ONNX_ENABLE_PYTHON=ON \
|
||||
-DPYTHON_EXECUTABLE="$(command -v python3)" \
|
||||
-DSHERPA_ONNX_ENABLE_TESTS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_JNI=ON \
|
||||
-DSHERPA_ONNX_ENABLE_SANITIZER=ON \
|
||||
@@ -76,6 +68,12 @@ jobs:
|
||||
|
||||
file ./bin/sherpa-onnx
|
||||
|
||||
- name: Run unit tests
|
||||
shell: bash
|
||||
run: |
|
||||
cd build
|
||||
ctest --output-on-failure
|
||||
|
||||
- name: Display dependencies of sherpa-onnx for macos
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
@@ -76,3 +76,11 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
.github/scripts/test-swift.sh
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tts-waves-${{ matrix.os }}
|
||||
path: |
|
||||
swift-api-examples/test-*-lexicon.wav
|
||||
swift-api-examples/generated-*.wav
|
||||
if-no-files-found: warn
|
||||
@@ -85,10 +85,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_TTS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=ON \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=ON \
|
||||
-DBUILD_PIPER_PHONMIZE_EXE=OFF \
|
||||
-DBUILD_PIPER_PHONMIZE_TESTS=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DBUILD_ESPEAK_NG_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
|
||||
@@ -168,11 +164,7 @@ jobs:
|
||||
cp -a build/install/bin $dst/
|
||||
cp -a build/install/lib $dst/
|
||||
cp -a build/install/include $dst/
|
||||
|
||||
rm -fv $dst/lib/cargs.h
|
||||
rm -fv $dst/lib/libcargs.so
|
||||
rm -fv $dst/lib/libonnxruntime4j_jni.so
|
||||
rm -fv $dst/include/cargs.h
|
||||
|
||||
echo "strip"
|
||||
strip $dst/bin/*
|
||||
@@ -315,10 +307,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_TTS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=ON \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=ON \
|
||||
-DBUILD_PIPER_PHONMIZE_EXE=OFF \
|
||||
-DBUILD_PIPER_PHONMIZE_TESTS=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DBUILD_ESPEAK_NG_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
|
||||
@@ -532,10 +520,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_TTS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=ON \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=ON \
|
||||
-DBUILD_PIPER_PHONMIZE_EXE=OFF \
|
||||
-DBUILD_PIPER_PHONMIZE_TESTS=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DBUILD_ESPEAK_NG_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
|
||||
@@ -615,11 +599,7 @@ jobs:
|
||||
cp -a build/install/bin $dst/
|
||||
cp -a build/install/lib $dst/
|
||||
cp -a build/install/include $dst/
|
||||
|
||||
rm -fv $dst/lib/cargs.h
|
||||
rm -fv $dst/lib/libcargs.so
|
||||
rm -fv $dst/lib/libonnxruntime4j_jni.so
|
||||
rm -fv $dst/include/cargs.h
|
||||
|
||||
echo "strip"
|
||||
strip $dst/bin/*
|
||||
@@ -771,10 +751,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_TTS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=ON \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=ON \
|
||||
-DBUILD_PIPER_PHONMIZE_EXE=OFF \
|
||||
-DBUILD_PIPER_PHONMIZE_TESTS=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DBUILD_ESPEAK_NG_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
|
||||
@@ -989,10 +965,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_TTS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=ON \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=ON \
|
||||
-DBUILD_PIPER_PHONMIZE_EXE=OFF \
|
||||
-DBUILD_PIPER_PHONMIZE_TESTS=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DBUILD_ESPEAK_NG_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
|
||||
@@ -1072,11 +1044,7 @@ jobs:
|
||||
cp -a build/install/bin $dst/
|
||||
cp -a build/install/lib $dst/
|
||||
cp -a build/install/include $dst/
|
||||
|
||||
rm -fv $dst/lib/cargs.h
|
||||
rm -fv $dst/lib/libcargs.so
|
||||
rm -fv $dst/lib/libonnxruntime4j_jni.so
|
||||
rm -fv $dst/include/cargs.h
|
||||
|
||||
echo "strip"
|
||||
strip $dst/bin/*
|
||||
@@ -1235,10 +1203,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_TTS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=ON \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=ON \
|
||||
-DBUILD_PIPER_PHONMIZE_EXE=OFF \
|
||||
-DBUILD_PIPER_PHONMIZE_TESTS=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DBUILD_ESPEAK_NG_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
|
||||
@@ -1318,11 +1282,7 @@ jobs:
|
||||
cp -a build/install/bin $dst/
|
||||
cp -a build/install/lib $dst/
|
||||
cp -a build/install/include $dst/
|
||||
|
||||
rm -fv $dst/lib/cargs.h
|
||||
rm -fv $dst/lib/libcargs.so
|
||||
rm -fv $dst/lib/libonnxruntime4j_jni.so
|
||||
rm -fv $dst/include/cargs.h
|
||||
|
||||
echo "strip"
|
||||
strip $dst/bin/*
|
||||
@@ -1466,10 +1426,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_TTS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=ON \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=ON \
|
||||
-DBUILD_PIPER_PHONMIZE_EXE=OFF \
|
||||
-DBUILD_PIPER_PHONMIZE_TESTS=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DBUILD_ESPEAK_NG_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
|
||||
@@ -1678,10 +1634,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_TTS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=ON \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=ON \
|
||||
-DBUILD_PIPER_PHONMIZE_EXE=OFF \
|
||||
-DBUILD_PIPER_PHONMIZE_TESTS=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DBUILD_ESPEAK_NG_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
|
||||
|
||||
@@ -5,15 +5,6 @@ on:
|
||||
branches:
|
||||
- dart-xcframework-2
|
||||
|
||||
schedule:
|
||||
# minute (0-59)
|
||||
# hour (0-23)
|
||||
# day of the month (1-31)
|
||||
# month (1-12)
|
||||
# day of the week (0-6)
|
||||
# nightly build at 15:50 UTC time every day
|
||||
- cron: "50 15 * * *"
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -82,6 +73,12 @@ jobs:
|
||||
run: |
|
||||
.github/scripts/test-dart.sh
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tts-waves-${{ github.job }}
|
||||
path: dart-api-examples/tts/*.wav
|
||||
if-no-files-found: warn
|
||||
|
||||
# Test using xcframework built from source (SPM approach)
|
||||
test_dart_package_xcframework:
|
||||
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
|
||||
@@ -164,3 +161,9 @@ jobs:
|
||||
cp scripts/dart/sherpa-onnx-pubspec.yaml flutter/sherpa_onnx/pubspec.yaml
|
||||
|
||||
.github/scripts/test-dart.sh
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tts-waves-${{ github.job }}
|
||||
path: dart-api-examples/tts/*.wav
|
||||
if-no-files-found: warn
|
||||
@@ -124,7 +124,6 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
@@ -183,3 +182,9 @@ jobs:
|
||||
cp scripts/dart/sherpa-onnx-pubspec.yaml flutter/sherpa_onnx/pubspec.yaml
|
||||
|
||||
.github/scripts/test-dart.sh
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tts-waves-${{ matrix.os }}
|
||||
path: dart-api-examples/tts/*.wav
|
||||
if-no-files-found: warn
|
||||
@@ -3,15 +3,6 @@ name: test-dot-net-nuget
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
schedule:
|
||||
# minute (0-59)
|
||||
# hour (0-23)
|
||||
# day of the month (1-31)
|
||||
# month (1-12)
|
||||
# day of the week (0-6)
|
||||
# nightly build at 23:50 UTC time every day
|
||||
- cron: "50 23 * * *"
|
||||
|
||||
concurrency:
|
||||
group: test-dot-net-nuget-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
@@ -62,7 +62,6 @@ jobs:
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
..
|
||||
|
||||
|
||||
@@ -0,0 +1,603 @@
|
||||
name: test-flutter-asr
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: test-flutter-asr-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
generate_matrix:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
desktop: ${{ steps.set-matrix.outputs.desktop }}
|
||||
android: ${{ steps.set-matrix.outputs.android }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Generating build matrix
|
||||
id: set-matrix
|
||||
shell: bash
|
||||
run: |
|
||||
JSON=$(python3 .github/scripts/flutter/generate_streaming_asr_matrix.py)
|
||||
DESKTOP=$(echo "$JSON" | python3 -c "import json,sys; d=json.load(sys.stdin); print(json.dumps(d['desktop']))")
|
||||
ANDROID=$(echo "$JSON" | python3 -c "import json,sys; d=json.load(sys.stdin); print(json.dumps(d['android']))")
|
||||
echo "desktop=$DESKTOP" >> $GITHUB_OUTPUT
|
||||
echo "android=$ANDROID" >> $GITHUB_OUTPUT
|
||||
|
||||
macos:
|
||||
name: macOS ${{ matrix.demo }} ${{ matrix.asr_model_name }}
|
||||
needs: [generate_matrix]
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson(needs.generate_matrix.outputs.desktop) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: macos-flutter-punct-${{ matrix.demo }}
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: 3.44.8
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Cache xcframework
|
||||
id: cache-xcframework
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: build-macos-shared-sherpa-with-static-onnxruntime/sherpa-onnx.xcframework
|
||||
key: macos-xcframework-${{ hashFiles('build-macos-shared-sherpa-with-static-onnxruntime.sh', 'CMakeLists.txt') }}
|
||||
restore-keys: |
|
||||
macos-xcframework-
|
||||
|
||||
- name: Build xcframework from source
|
||||
if: steps.cache-xcframework.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
./build-macos-shared-sherpa-with-static-onnxruntime.sh
|
||||
|
||||
- name: Copy xcframework
|
||||
shell: bash
|
||||
run: |
|
||||
cp -av build-macos-shared-sherpa-with-static-onnxruntime/sherpa-onnx.xcframework flutter/sherpa_onnx_macos/macos/sherpa_onnx_macos/sherpa-onnx.xcframework
|
||||
ls -lh flutter/sherpa_onnx_macos/macos/sherpa_onnx_macos/sherpa-onnx.xcframework/
|
||||
|
||||
- name: Use local sherpa_onnx_macos
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's| sherpa_onnx_macos: 1.13.8| # sherpa_onnx_macos: 1.13.8\n sherpa_onnx_macos:\n path: ../sherpa_onnx_macos|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
cat pubspec.yaml
|
||||
|
||||
- name: Remove sherpa_onnx_web dependency
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's|^ sherpa_onnx_web:.*| # sherpa_onnx_web: 1.13.8|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
|
||||
- name: Download model
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/assets
|
||||
rm -fv .gitkeep
|
||||
curl -sSL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/${{ matrix.asr_tarball }}
|
||||
tar xf ${{ matrix.asr_tarball }}
|
||||
rm ${{ matrix.asr_tarball }}
|
||||
${{ matrix.asr_post_cmd }}
|
||||
cd ..
|
||||
sed -i.bak "s| - assets/$| - assets/\n - assets/${{ matrix.asr_model_name }}/|g" ./pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
- name: Set model type
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
sed -i.bak "s/final type = .*;$/final type = ${{ matrix.asr_model_index }};/g" lib/streaming_asr.dart
|
||||
rm -f lib/streaming_asr.dart.bak
|
||||
if [ -n "${{ matrix.asr_rule_fsts }}" ]; then
|
||||
sed -i.bak "s|ruleFsts: ''|ruleFsts: await copyAssetFile('assets/${{ matrix.asr_rule_fsts }}')|g" lib/streaming_asr.dart
|
||||
rm -f lib/streaming_asr.dart.bak
|
||||
fi
|
||||
grep 'final type\|ruleFsts' lib/streaming_asr.dart
|
||||
|
||||
- name: Copy LICENSE for sherpa_onnx_macos podspec
|
||||
shell: bash
|
||||
run: |
|
||||
cp LICENSE flutter/sherpa_onnx_macos/LICENSE
|
||||
|
||||
- name: Build Flutter app
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
|
||||
sed -i.bak 's|sherpa_onnx: 1.13.8|sherpa_onnx:\n path: ../../flutter/sherpa_onnx|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
flutter config --no-enable-swift-package-manager
|
||||
flutter pub get
|
||||
cd macos && pod install && cd ..
|
||||
flutter build macos
|
||||
|
||||
ls -lh build/macos/Build/Products/Release/
|
||||
|
||||
- name: Ad-hoc sign the app
|
||||
shell: bash
|
||||
run: |
|
||||
app_name=$(echo ${{ matrix.demo }} | tr '-' '_')
|
||||
codesign --force --deep -s - flutter-examples/${{ matrix.demo }}/build/macos/Build/Products/Release/${app_name}.app
|
||||
xattr -cr flutter-examples/${{ matrix.demo }}/build/macos/Build/Products/Release/${app_name}.app
|
||||
|
||||
- name: Zip app
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/build/macos/Build/Products/Release/
|
||||
app_name=$(echo ${{ matrix.demo }} | tr '-' '_')
|
||||
# Rename the bundle so the extracted app carries the model name.
|
||||
mv ${app_name}.app ${{ matrix.demo }}-${{ matrix.asr_model_name }}.app
|
||||
zip -r -y flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-macos.zip ${{ matrix.demo }}-${{ matrix.asr_model_name }}.app/
|
||||
ls -lh flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-macos.zip
|
||||
|
||||
- name: Release
|
||||
if: github.repository_owner == 'csukuangfj'
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
file_glob: true
|
||||
overwrite: true
|
||||
file: ./flutter-examples/${{ matrix.demo }}/build/macos/Build/Products/Release/flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-macos.zip
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: flutter
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-macos
|
||||
path: flutter-examples/${{ matrix.demo }}/build/macos/Build/Products/Release/flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-macos.zip
|
||||
|
||||
linux:
|
||||
name: Linux ${{ matrix.demo }} ${{ matrix.asr_model_name }}
|
||||
needs: [generate_matrix]
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson(needs.generate_matrix.outputs.desktop) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: linux-flutter-punct-${{ matrix.demo }}
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update
|
||||
# libgstreamer*: required by audioplayers_linux (the tts demo plays
|
||||
# the generated audio).
|
||||
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: latest
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build sherpa-onnx from source
|
||||
shell: bash
|
||||
run: |
|
||||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
mkdir build
|
||||
cd build
|
||||
cmake \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
cmake --build . --target install --config Release
|
||||
|
||||
- name: Copy libs
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ $(uname -m) == "aarch64" ]]; then
|
||||
arch=aarch64
|
||||
else
|
||||
arch=x64
|
||||
fi
|
||||
cp -fv build/install/lib/lib* ./flutter/sherpa_onnx_linux/linux/$arch
|
||||
ls -lh ./flutter/sherpa_onnx_linux/linux/$arch
|
||||
|
||||
- name: Use local sherpa_onnx_linux
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's| sherpa_onnx_linux: 1.13.8| # sherpa_onnx_linux: 1.13.8\n sherpa_onnx_linux:\n path: ../sherpa_onnx_linux|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
cat pubspec.yaml
|
||||
|
||||
- name: Remove sherpa_onnx_web dependency
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's|^ sherpa_onnx_web:.*| # sherpa_onnx_web: 1.13.8|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
|
||||
- name: Download model
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/assets
|
||||
rm -fv .gitkeep
|
||||
curl -sSL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/${{ matrix.asr_tarball }}
|
||||
tar xf ${{ matrix.asr_tarball }}
|
||||
rm ${{ matrix.asr_tarball }}
|
||||
${{ matrix.asr_post_cmd }}
|
||||
cd ..
|
||||
sed -i.bak "s| - assets/$| - assets/\n - assets/${{ matrix.asr_model_name }}/|g" ./pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
- name: Set model type
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
sed -i.bak "s/final type = .*;$/final type = ${{ matrix.asr_model_index }};/g" lib/streaming_asr.dart
|
||||
rm -f lib/streaming_asr.dart.bak
|
||||
if [ -n "${{ matrix.asr_rule_fsts }}" ]; then
|
||||
sed -i.bak "s|ruleFsts: ''|ruleFsts: await copyAssetFile('assets/${{ matrix.asr_rule_fsts }}')|g" lib/streaming_asr.dart
|
||||
rm -f lib/streaming_asr.dart.bak
|
||||
fi
|
||||
grep 'final type\|ruleFsts' lib/streaming_asr.dart
|
||||
|
||||
- name: Build Flutter app
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
|
||||
sed -i.bak 's|sherpa_onnx: 1.13.8|sherpa_onnx:\n path: ../../flutter/sherpa_onnx|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
flutter pub get
|
||||
flutter build linux
|
||||
|
||||
ls -lh build/linux/*/release/bundle/
|
||||
|
||||
- name: Zip app
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/build/linux/*/release/
|
||||
# Rename the bundle dir so the extracted folder carries the model name.
|
||||
mv bundle ${{ matrix.demo }}-${{ matrix.asr_model_name }}
|
||||
zip -r -y flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-linux-x64.zip ${{ matrix.demo }}-${{ matrix.asr_model_name }}/
|
||||
ls -lh flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-linux-x64.zip
|
||||
|
||||
- name: Release
|
||||
if: github.repository_owner == 'csukuangfj'
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
file_glob: true
|
||||
overwrite: true
|
||||
file: ./flutter-examples/${{ matrix.demo }}/build/linux/*/release/flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-linux-x64.zip
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: flutter
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-linux-x64
|
||||
path: flutter-examples/${{ matrix.demo }}/build/linux/*/release/flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-linux-x64.zip
|
||||
|
||||
windows:
|
||||
name: Windows ${{ matrix.demo }} ${{ matrix.asr_model_name }}
|
||||
needs: [generate_matrix]
|
||||
runs-on: windows-2022
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson(needs.generate_matrix.outputs.desktop) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: latest
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build sherpa-onnx from source
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
cmake --build . --target install --config Release
|
||||
|
||||
- name: Copy libs
|
||||
shell: bash
|
||||
run: |
|
||||
cp -fv build/install/lib/*.dll ./flutter/sherpa_onnx_windows/windows/x64/
|
||||
ls -lh ./flutter/sherpa_onnx_windows/windows/x64/
|
||||
|
||||
- name: Use local sherpa_onnx_windows
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's| sherpa_onnx_windows: 1.13.8| # sherpa_onnx_windows: 1.13.8\n sherpa_onnx_windows:\n path: ../sherpa_onnx_windows|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
cat pubspec.yaml
|
||||
|
||||
- name: Remove sherpa_onnx_web dependency
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's|^ sherpa_onnx_web:.*| # sherpa_onnx_web: 1.13.8|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
- name: Download model
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/assets
|
||||
rm -fv .gitkeep
|
||||
curl -sSL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/${{ matrix.asr_tarball }}
|
||||
tar xf ${{ matrix.asr_tarball }}
|
||||
rm ${{ matrix.asr_tarball }}
|
||||
${{ matrix.asr_post_cmd }}
|
||||
cd ..
|
||||
sed -i.bak "s| - assets/$| - assets/\n - assets/${{ matrix.asr_model_name }}/|g" ./pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
- name: Set model type
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
sed -i.bak "s/final type = .*;$/final type = ${{ matrix.asr_model_index }};/g" lib/streaming_asr.dart
|
||||
rm -f lib/streaming_asr.dart.bak
|
||||
if [ -n "${{ matrix.asr_rule_fsts }}" ]; then
|
||||
sed -i.bak "s|ruleFsts: ''|ruleFsts: await copyAssetFile('assets/${{ matrix.asr_rule_fsts }}')|g" lib/streaming_asr.dart
|
||||
rm -f lib/streaming_asr.dart.bak
|
||||
fi
|
||||
grep 'final type\|ruleFsts' lib/streaming_asr.dart
|
||||
|
||||
- name: Build Flutter app
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
|
||||
sed -i.bak 's|sherpa_onnx: 1.13.8|sherpa_onnx:\n path: ../../flutter/sherpa_onnx|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
flutter pub get
|
||||
flutter build windows
|
||||
|
||||
ls -lh build/windows/x64/runner/Release/
|
||||
|
||||
- name: Zip app
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/build/windows/x64/runner/
|
||||
# Rename the folder so the extracted app carries the model name.
|
||||
mv Release ${{ matrix.demo }}-${{ matrix.asr_model_name }}
|
||||
powershell -Command "Compress-Archive -Path ${{ matrix.demo }}-${{ matrix.asr_model_name }} -DestinationPath flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-win-x64.zip"
|
||||
ls -lh flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-win-x64.zip
|
||||
|
||||
- name: Release
|
||||
if: github.repository_owner == 'csukuangfj'
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
file_glob: true
|
||||
overwrite: true
|
||||
file: ./flutter-examples/${{ matrix.demo }}/build/windows/x64/runner/flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-win-x64.zip
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: flutter
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-win-x64
|
||||
path: flutter-examples/${{ matrix.demo }}/build/windows/x64/runner/flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-win-x64.zip
|
||||
|
||||
android:
|
||||
name: Android (${{ matrix.demo }}, ${{ matrix.asr_model_name }}, ${{ matrix.abi }})
|
||||
needs: [generate_matrix]
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson(needs.generate_matrix.outputs.android) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: android-flutter-punct-${{ matrix.demo }}-${{ matrix.abi }}
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: latest
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build ${{ matrix.abi }} from source
|
||||
shell: bash
|
||||
run: |
|
||||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
export SHERPA_ONNX_ENABLE_C_API=ON
|
||||
export SHERPA_ONNX_ENABLE_JNI=OFF
|
||||
export SHERPA_ONNX_ENABLE_BINARY=OFF
|
||||
./${{ matrix.build_script }}
|
||||
|
||||
- name: Copy libs
|
||||
shell: bash
|
||||
run: |
|
||||
cp -fv ${{ matrix.build_dir }}/install/lib/lib*.so flutter/${{ matrix.plugin }}/android/src/main/jniLibs/${{ matrix.abi }}/
|
||||
ls -lh flutter/${{ matrix.plugin }}/android/src/main/jniLibs/${{ matrix.abi }}/
|
||||
|
||||
- name: Use local ${{ matrix.plugin }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's| ${{ matrix.plugin_key }}: 1.13.8| # ${{ matrix.plugin_key }}: 1.13.8\n ${{ matrix.plugin_key }}:\n path: ../${{ matrix.plugin }}|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
cat pubspec.yaml
|
||||
|
||||
|
||||
- name: Download model
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/assets
|
||||
rm -fv .gitkeep
|
||||
curl -sSL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/${{ matrix.asr_tarball }}
|
||||
tar xf ${{ matrix.asr_tarball }}
|
||||
rm ${{ matrix.asr_tarball }}
|
||||
${{ matrix.asr_post_cmd }}
|
||||
cd ..
|
||||
sed -i.bak "s| - assets/$| - assets/\n - assets/${{ matrix.asr_model_name }}/|g" ./pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
- name: Set model type
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
sed -i.bak "s/final type = .*;$/final type = ${{ matrix.asr_model_index }};/g" lib/streaming_asr.dart
|
||||
rm -f lib/streaming_asr.dart.bak
|
||||
if [ -n "${{ matrix.asr_rule_fsts }}" ]; then
|
||||
sed -i.bak "s|ruleFsts: ''|ruleFsts: await copyAssetFile('assets/${{ matrix.asr_rule_fsts }}')|g" lib/streaming_asr.dart
|
||||
rm -f lib/streaming_asr.dart.bak
|
||||
fi
|
||||
grep 'final type\|ruleFsts' lib/streaming_asr.dart
|
||||
|
||||
- name: Build Flutter APK
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
|
||||
sed -i.bak 's|sherpa_onnx: 1.13.8|sherpa_onnx:\n path: ../../flutter/sherpa_onnx|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
flutter pub get
|
||||
flutter build apk --split-per-abi --target-platform ${{ matrix.target_platform }}
|
||||
|
||||
ls -lh build/app/outputs/flutter-apk/
|
||||
|
||||
- name: Rename APK
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/build/app/outputs/flutter-apk/
|
||||
mv app-*-release.apk flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-${{ matrix.abi }}.apk
|
||||
ls -lh *.apk
|
||||
|
||||
- name: Release
|
||||
if: github.repository_owner == 'csukuangfj'
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
file_glob: true
|
||||
overwrite: true
|
||||
file: ./flutter-examples/${{ matrix.demo }}/build/app/outputs/flutter-apk/flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-${{ matrix.abi }}.apk
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: flutter
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-android-${{ matrix.abi }}
|
||||
path: flutter-examples/${{ matrix.demo }}/build/app/outputs/flutter-apk/flutter-${{ matrix.demo }}-${{ matrix.asr_model_name }}-${{ matrix.abi }}.apk
|
||||
|
||||
@@ -214,7 +214,6 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
@@ -344,7 +343,6 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
|
||||
@@ -0,0 +1,702 @@
|
||||
name: test-flutter-tts
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: test-flutter-tts-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
generate_matrix:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
desktop: ${{ steps.set-matrix.outputs.desktop }}
|
||||
android: ${{ steps.set-matrix.outputs.android }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Generating build matrix
|
||||
id: set-matrix
|
||||
shell: bash
|
||||
run: |
|
||||
JSON=$(python3 .github/scripts/flutter/generate_tts_matrix.py)
|
||||
DESKTOP=$(echo "$JSON" | python3 -c "import json,sys; d=json.load(sys.stdin); print(json.dumps(d['desktop']))")
|
||||
ANDROID=$(echo "$JSON" | python3 -c "import json,sys; d=json.load(sys.stdin); print(json.dumps(d['android']))")
|
||||
echo "desktop=$DESKTOP" >> $GITHUB_OUTPUT
|
||||
echo "android=$ANDROID" >> $GITHUB_OUTPUT
|
||||
|
||||
macos:
|
||||
name: macOS ${{ matrix.demo }} ${{ matrix.tts_model_name }}
|
||||
needs: [generate_matrix]
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson(needs.generate_matrix.outputs.desktop) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: macos-flutter-punct-${{ matrix.demo }}
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: 3.44.8
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Cache xcframework
|
||||
id: cache-xcframework
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: build-macos-shared-sherpa-with-static-onnxruntime/sherpa-onnx.xcframework
|
||||
key: macos-xcframework-${{ hashFiles('build-macos-shared-sherpa-with-static-onnxruntime.sh', 'CMakeLists.txt') }}
|
||||
restore-keys: |
|
||||
macos-xcframework-
|
||||
|
||||
- name: Build xcframework from source
|
||||
if: steps.cache-xcframework.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
./build-macos-shared-sherpa-with-static-onnxruntime.sh
|
||||
|
||||
- name: Copy xcframework
|
||||
shell: bash
|
||||
run: |
|
||||
cp -av build-macos-shared-sherpa-with-static-onnxruntime/sherpa-onnx.xcframework flutter/sherpa_onnx_macos/macos/sherpa_onnx_macos/sherpa-onnx.xcframework
|
||||
ls -lh flutter/sherpa_onnx_macos/macos/sherpa_onnx_macos/sherpa-onnx.xcframework/
|
||||
|
||||
- name: Use local sherpa_onnx_macos
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's| sherpa_onnx_macos: 1.13.8| # sherpa_onnx_macos: 1.13.8\n sherpa_onnx_macos:\n path: ../sherpa_onnx_macos|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
cat pubspec.yaml
|
||||
|
||||
- name: Remove sherpa_onnx_web dependency
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's|^ sherpa_onnx_web:.*| # sherpa_onnx_web: 1.13.8|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
|
||||
- name: Download model
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/assets
|
||||
rm -fv .gitkeep
|
||||
curl -sSL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/${{ matrix.tts_tarball }}
|
||||
tar xf ${{ matrix.tts_tarball }}
|
||||
rm ${{ matrix.tts_tarball }}
|
||||
${{ matrix.tts_extra_cmd }}
|
||||
${{ matrix.tts_cleanup_cmd }}
|
||||
cd ..
|
||||
./generate-asset-list.py
|
||||
|
||||
- name: Set selectedModelIndex
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
sed -i.bak "s|const int selectedModelIndex = [0-9]*;|const int selectedModelIndex = ${{ matrix.tts_model_index }};|" lib/model_config.dart
|
||||
rm -f lib/model_config.dart.bak
|
||||
grep 'selectedModelIndex' lib/model_config.dart
|
||||
|
||||
- name: Copy LICENSE for sherpa_onnx_macos podspec
|
||||
shell: bash
|
||||
run: |
|
||||
cp LICENSE flutter/sherpa_onnx_macos/LICENSE
|
||||
|
||||
- name: Build Flutter app
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
|
||||
sed -i.bak 's|sherpa_onnx: 1.13.8|sherpa_onnx:\n path: ../../flutter/sherpa_onnx|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
flutter config --no-enable-swift-package-manager
|
||||
flutter pub get
|
||||
cd macos && pod install && cd ..
|
||||
flutter build macos
|
||||
|
||||
ls -lh build/macos/Build/Products/Release/
|
||||
|
||||
- name: Ad-hoc sign the app
|
||||
shell: bash
|
||||
run: |
|
||||
app_name=$(echo ${{ matrix.demo }} | tr '-' '_')
|
||||
codesign --force --deep -s - flutter-examples/${{ matrix.demo }}/build/macos/Build/Products/Release/${app_name}.app
|
||||
xattr -cr flutter-examples/${{ matrix.demo }}/build/macos/Build/Products/Release/${app_name}.app
|
||||
|
||||
- name: Zip app
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/build/macos/Build/Products/Release/
|
||||
app_name=$(echo ${{ matrix.demo }} | tr '-' '_')
|
||||
# Rename the bundle so the extracted app carries the model name.
|
||||
mv ${app_name}.app tts-${{ matrix.tts_model_name }}.app
|
||||
zip -r -y flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-macos.zip tts-${{ matrix.tts_model_name }}.app/
|
||||
ls -lh flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-macos.zip
|
||||
|
||||
- name: Release
|
||||
if: github.repository_owner == 'csukuangfj'
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
file_glob: true
|
||||
overwrite: true
|
||||
file: ./flutter-examples/${{ matrix.demo }}/build/macos/Build/Products/Release/flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-macos.zip
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: flutter
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-macos
|
||||
path: flutter-examples/${{ matrix.demo }}/build/macos/Build/Products/Release/flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-macos.zip
|
||||
|
||||
linux:
|
||||
name: Linux ${{ matrix.demo }} ${{ matrix.tts_model_name }}
|
||||
needs: [generate_matrix]
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson(needs.generate_matrix.outputs.desktop) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: linux-flutter-punct-${{ matrix.demo }}
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update
|
||||
# libgstreamer*: required by audioplayers_linux (the tts demo plays
|
||||
# the generated audio).
|
||||
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: latest
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build sherpa-onnx from source
|
||||
shell: bash
|
||||
run: |
|
||||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
mkdir build
|
||||
cd build
|
||||
cmake \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
cmake --build . --target install --config Release
|
||||
|
||||
- name: Copy libs
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ $(uname -m) == "aarch64" ]]; then
|
||||
arch=aarch64
|
||||
else
|
||||
arch=x64
|
||||
fi
|
||||
cp -fv build/install/lib/lib* ./flutter/sherpa_onnx_linux/linux/$arch
|
||||
ls -lh ./flutter/sherpa_onnx_linux/linux/$arch
|
||||
|
||||
- name: Use local sherpa_onnx_linux
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's| sherpa_onnx_linux: 1.13.8| # sherpa_onnx_linux: 1.13.8\n sherpa_onnx_linux:\n path: ../sherpa_onnx_linux|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
cat pubspec.yaml
|
||||
|
||||
- name: Remove sherpa_onnx_web dependency
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's|^ sherpa_onnx_web:.*| # sherpa_onnx_web: 1.13.8|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
|
||||
- name: Download model
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/assets
|
||||
rm -fv .gitkeep
|
||||
curl -sSL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/${{ matrix.tts_tarball }}
|
||||
tar xf ${{ matrix.tts_tarball }}
|
||||
rm ${{ matrix.tts_tarball }}
|
||||
${{ matrix.tts_extra_cmd }}
|
||||
${{ matrix.tts_cleanup_cmd }}
|
||||
cd ..
|
||||
./generate-asset-list.py
|
||||
|
||||
- name: Set selectedModelIndex
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
sed -i.bak "s|const int selectedModelIndex = [0-9]*;|const int selectedModelIndex = ${{ matrix.tts_model_index }};|" lib/model_config.dart
|
||||
rm -f lib/model_config.dart.bak
|
||||
grep 'selectedModelIndex' lib/model_config.dart
|
||||
|
||||
- name: Build Flutter app
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
|
||||
sed -i.bak 's|sherpa_onnx: 1.13.8|sherpa_onnx:\n path: ../../flutter/sherpa_onnx|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
flutter pub get
|
||||
flutter build linux
|
||||
|
||||
ls -lh build/linux/*/release/bundle/
|
||||
|
||||
- name: Zip app
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/build/linux/*/release/
|
||||
# Rename the bundle dir so the extracted folder carries the model name.
|
||||
mv bundle tts-${{ matrix.tts_model_name }}
|
||||
zip -r -y flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-linux-x64.zip tts-${{ matrix.tts_model_name }}/
|
||||
ls -lh flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-linux-x64.zip
|
||||
|
||||
- name: Release
|
||||
if: github.repository_owner == 'csukuangfj'
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
file_glob: true
|
||||
overwrite: true
|
||||
file: ./flutter-examples/${{ matrix.demo }}/build/linux/*/release/flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-linux-x64.zip
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: flutter
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-linux-x64
|
||||
path: flutter-examples/${{ matrix.demo }}/build/linux/*/release/flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-linux-x64.zip
|
||||
|
||||
windows:
|
||||
name: Windows ${{ matrix.demo }} ${{ matrix.tts_model_name }}
|
||||
needs: [generate_matrix]
|
||||
runs-on: windows-2022
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson(needs.generate_matrix.outputs.desktop) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: latest
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build sherpa-onnx from source
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
cmake --build . --target install --config Release
|
||||
|
||||
- name: Copy libs
|
||||
shell: bash
|
||||
run: |
|
||||
cp -fv build/install/lib/*.dll ./flutter/sherpa_onnx_windows/windows/x64/
|
||||
ls -lh ./flutter/sherpa_onnx_windows/windows/x64/
|
||||
|
||||
- name: Use local sherpa_onnx_windows
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's| sherpa_onnx_windows: 1.13.8| # sherpa_onnx_windows: 1.13.8\n sherpa_onnx_windows:\n path: ../sherpa_onnx_windows|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
cat pubspec.yaml
|
||||
|
||||
- name: Remove sherpa_onnx_web dependency
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's|^ sherpa_onnx_web:.*| # sherpa_onnx_web: 1.13.8|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
- name: Download model
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/assets
|
||||
rm -fv .gitkeep
|
||||
curl -sSL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/${{ matrix.tts_tarball }}
|
||||
tar xf ${{ matrix.tts_tarball }}
|
||||
rm ${{ matrix.tts_tarball }}
|
||||
${{ matrix.tts_extra_cmd }}
|
||||
${{ matrix.tts_cleanup_cmd }}
|
||||
cd ..
|
||||
./generate-asset-list.py
|
||||
|
||||
- name: Set selectedModelIndex
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
sed -i.bak "s|const int selectedModelIndex = [0-9]*;|const int selectedModelIndex = ${{ matrix.tts_model_index }};|" lib/model_config.dart
|
||||
rm -f lib/model_config.dart.bak
|
||||
grep 'selectedModelIndex' lib/model_config.dart
|
||||
|
||||
- name: Build Flutter app
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
|
||||
sed -i.bak 's|sherpa_onnx: 1.13.8|sherpa_onnx:\n path: ../../flutter/sherpa_onnx|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
flutter pub get
|
||||
flutter build windows
|
||||
|
||||
ls -lh build/windows/x64/runner/Release/
|
||||
|
||||
- name: Zip app
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/build/windows/x64/runner/
|
||||
# Rename the folder so the extracted app carries the model name.
|
||||
mv Release tts-${{ matrix.tts_model_name }}
|
||||
powershell -Command "Compress-Archive -Path tts-${{ matrix.tts_model_name }} -DestinationPath flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-win-x64.zip"
|
||||
ls -lh flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-win-x64.zip
|
||||
|
||||
- name: Release
|
||||
if: github.repository_owner == 'csukuangfj'
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
file_glob: true
|
||||
overwrite: true
|
||||
file: ./flutter-examples/${{ matrix.demo }}/build/windows/x64/runner/flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-win-x64.zip
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: flutter
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-win-x64
|
||||
path: flutter-examples/${{ matrix.demo }}/build/windows/x64/runner/flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-win-x64.zip
|
||||
|
||||
android:
|
||||
name: Android (${{ matrix.demo }}, ${{ matrix.tts_model_name }}, ${{ matrix.abi }})
|
||||
needs: [generate_matrix]
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson(needs.generate_matrix.outputs.android) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: android-flutter-punct-${{ matrix.demo }}-${{ matrix.abi }}
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: latest
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build ${{ matrix.abi }} from source
|
||||
shell: bash
|
||||
run: |
|
||||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
export SHERPA_ONNX_ENABLE_C_API=ON
|
||||
export SHERPA_ONNX_ENABLE_JNI=OFF
|
||||
export SHERPA_ONNX_ENABLE_BINARY=OFF
|
||||
./${{ matrix.build_script }}
|
||||
|
||||
- name: Copy libs
|
||||
shell: bash
|
||||
run: |
|
||||
cp -fv ${{ matrix.build_dir }}/install/lib/lib*.so flutter/${{ matrix.plugin }}/android/src/main/jniLibs/${{ matrix.abi }}/
|
||||
ls -lh flutter/${{ matrix.plugin }}/android/src/main/jniLibs/${{ matrix.abi }}/
|
||||
|
||||
- name: Use local ${{ matrix.plugin }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's| ${{ matrix.plugin_key }}: 1.13.8| # ${{ matrix.plugin_key }}: 1.13.8\n ${{ matrix.plugin_key }}:\n path: ../${{ matrix.plugin }}|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
cat pubspec.yaml
|
||||
|
||||
|
||||
- name: Download model
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/assets
|
||||
rm -fv .gitkeep
|
||||
curl -sSL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/${{ matrix.tts_tarball }}
|
||||
tar xf ${{ matrix.tts_tarball }}
|
||||
rm ${{ matrix.tts_tarball }}
|
||||
${{ matrix.tts_extra_cmd }}
|
||||
${{ matrix.tts_cleanup_cmd }}
|
||||
cd ..
|
||||
./generate-asset-list.py
|
||||
|
||||
- name: Set selectedModelIndex
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
sed -i.bak "s|const int selectedModelIndex = [0-9]*;|const int selectedModelIndex = ${{ matrix.tts_model_index }};|" lib/model_config.dart
|
||||
rm -f lib/model_config.dart.bak
|
||||
grep 'selectedModelIndex' lib/model_config.dart
|
||||
|
||||
- name: Build Flutter APK
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
|
||||
sed -i.bak 's|sherpa_onnx: 1.13.8|sherpa_onnx:\n path: ../../flutter/sherpa_onnx|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
flutter pub get
|
||||
flutter build apk --split-per-abi --target-platform ${{ matrix.target_platform }}
|
||||
|
||||
ls -lh build/app/outputs/flutter-apk/
|
||||
|
||||
- name: Rename APK
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/build/app/outputs/flutter-apk/
|
||||
mv app-*-release.apk flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-${{ matrix.abi }}.apk
|
||||
ls -lh *.apk
|
||||
|
||||
- name: Release
|
||||
if: github.repository_owner == 'csukuangfj'
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
file_glob: true
|
||||
overwrite: true
|
||||
file: ./flutter-examples/${{ matrix.demo }}/build/app/outputs/flutter-apk/flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-${{ matrix.abi }}.apk
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: flutter
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-android-${{ matrix.abi }}
|
||||
path: flutter-examples/${{ matrix.demo }}/build/app/outputs/flutter-apk/flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-${{ matrix.abi }}.apk
|
||||
|
||||
web:
|
||||
name: Web ${{ matrix.demo }} ${{ matrix.tts_model_name }}
|
||||
needs: [generate_matrix]
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson(needs.generate_matrix.outputs.desktop) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: Install Emscripten
|
||||
uses: mymindstorm/setup-emsdk@v14
|
||||
with:
|
||||
version: 4.0.23
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v4
|
||||
with:
|
||||
channel: stable
|
||||
version: latest
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build WASM module
|
||||
shell: bash
|
||||
run: |
|
||||
./build-wasm-simd-web.sh
|
||||
|
||||
- name: Copy WASM assets to web plugin
|
||||
shell: bash
|
||||
run: |
|
||||
./build-flutter-web-wasm.sh
|
||||
|
||||
- name: Download model
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/assets
|
||||
rm -fv .gitkeep
|
||||
curl -sSL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/${{ matrix.tts_tarball }}
|
||||
tar xf ${{ matrix.tts_tarball }}
|
||||
rm ${{ matrix.tts_tarball }}
|
||||
${{ matrix.tts_extra_cmd }}
|
||||
${{ matrix.tts_cleanup_cmd }}
|
||||
cd ..
|
||||
./generate-asset-list.py
|
||||
|
||||
- name: Set selectedModelIndex
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
sed -i.bak "s|const int selectedModelIndex = [0-9]*;|const int selectedModelIndex = ${{ matrix.tts_model_index }};|" lib/model_config.dart
|
||||
rm -f lib/model_config.dart.bak
|
||||
grep 'selectedModelIndex' lib/model_config.dart
|
||||
|
||||
|
||||
- name: Use local sherpa_onnx_web
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter/sherpa_onnx
|
||||
sed -i.bak 's|^ sherpa_onnx_web:.*| # sherpa_onnx_web: 1.13.8\n sherpa_onnx_web:\n path: ../sherpa_onnx_web|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
- name: Build Flutter web app
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}
|
||||
|
||||
sed -i.bak 's|sherpa_onnx: 1.13.8|sherpa_onnx:\n path: ../../flutter/sherpa_onnx|' pubspec.yaml
|
||||
rm -f pubspec.yaml.bak
|
||||
|
||||
flutter pub get
|
||||
flutter build web
|
||||
|
||||
ls -lh build/web/
|
||||
|
||||
- name: Zip web app
|
||||
shell: bash
|
||||
run: |
|
||||
cd flutter-examples/${{ matrix.demo }}/build/
|
||||
# Rename the folder so the extracted app carries the model name.
|
||||
mv web tts-${{ matrix.tts_model_name }}
|
||||
zip -r -y flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-web.zip tts-${{ matrix.tts_model_name }}/
|
||||
ls -lh flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-web.zip
|
||||
|
||||
- name: Release
|
||||
if: github.repository_owner == 'csukuangfj'
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
file_glob: true
|
||||
overwrite: true
|
||||
file: ./flutter-examples/${{ matrix.demo }}/build/flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-web.zip
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: flutter
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-web
|
||||
path: flutter-examples/${{ matrix.demo }}/build/flutter-${{ matrix.demo }}-${{ matrix.tts_model_name }}-web.zip
|
||||
@@ -260,7 +260,6 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
@@ -409,7 +408,6 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
|
||||
@@ -222,7 +222,6 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
@@ -349,7 +348,6 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
|
||||
@@ -426,7 +426,6 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
@@ -508,7 +507,6 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
|
||||
@@ -4,14 +4,6 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- fix-go-2
|
||||
schedule:
|
||||
# minute (0-59)
|
||||
# hour (0-23)
|
||||
# day of the month (1-31)
|
||||
# month (1-12)
|
||||
# day of the week (0-6)
|
||||
# nightly build at 15:50 UTC time every day
|
||||
- cron: "50 15 * * *"
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -44,7 +36,7 @@ jobs:
|
||||
- os: macos-latest
|
||||
arch: arm64
|
||||
index: 3
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts streaming-decode-files"
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts non-streaming-tts-phonemize streaming-decode-files"
|
||||
- os: macos-latest
|
||||
arch: arm64
|
||||
index: 4
|
||||
@@ -73,7 +65,7 @@ jobs:
|
||||
- os: macos-15-intel
|
||||
arch: amd64
|
||||
index: 3
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts streaming-decode-files"
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts non-streaming-tts-phonemize streaming-decode-files"
|
||||
- os: macos-15-intel
|
||||
arch: amd64
|
||||
index: 4
|
||||
@@ -102,7 +94,7 @@ jobs:
|
||||
- os: ubuntu-latest
|
||||
arch: amd64
|
||||
index: 3
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts streaming-decode-files"
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts non-streaming-tts-phonemize streaming-decode-files"
|
||||
- os: ubuntu-latest
|
||||
arch: amd64
|
||||
index: 4
|
||||
@@ -131,7 +123,7 @@ jobs:
|
||||
- os: ubuntu-22.04-arm
|
||||
arch: arm64
|
||||
index: 3
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts streaming-decode-files"
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts non-streaming-tts-phonemize streaming-decode-files"
|
||||
- os: ubuntu-22.04-arm
|
||||
arch: arm64
|
||||
index: 4
|
||||
@@ -160,7 +152,7 @@ jobs:
|
||||
- os: windows-2022
|
||||
arch: x64
|
||||
index: 3
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts streaming-decode-files"
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts non-streaming-tts-phonemize streaming-decode-files"
|
||||
- os: windows-2022
|
||||
arch: x64
|
||||
index: 4
|
||||
@@ -189,7 +181,7 @@ jobs:
|
||||
- os: windows-2022
|
||||
arch: x86
|
||||
index: 3
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts streaming-decode-files"
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts non-streaming-tts-phonemize streaming-decode-files"
|
||||
- os: windows-2022
|
||||
arch: x86
|
||||
index: 4
|
||||
@@ -218,7 +210,7 @@ jobs:
|
||||
- os: windows-11-arm
|
||||
arch: arm64
|
||||
index: 3
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts streaming-decode-files"
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts non-streaming-tts-phonemize streaming-decode-files"
|
||||
- os: windows-11-arm
|
||||
arch: arm64
|
||||
index: 4
|
||||
@@ -239,7 +231,12 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '>=1.17'
|
||||
# windows/arm64 needs Go >= 1.27: Go 1.26 cgo passes the MinGW-only
|
||||
# -mthreads flag, which clang rejects when it targets
|
||||
# aarch64-pc-windows-msvc (the ABI used to link the MSVC-built
|
||||
# sherpa-onnx-c-api.dll). Go 1.27 passes -pthread instead.
|
||||
# Other platforms keep the flexible spec.
|
||||
go-version: ${{ matrix.os == 'windows-11-arm' && '1.27.x' || '>=1.17' }}
|
||||
|
||||
- name: Set up MinGW for x64
|
||||
if: matrix.os == 'windows-2022' && matrix.arch == 'x64'
|
||||
@@ -313,7 +310,16 @@ jobs:
|
||||
done
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: contains(matrix.tests, 'non-streaming-tts') || contains(matrix.tests, 'zero-shot-zipvoice-tts')
|
||||
if: contains(matrix.tests, 'non-streaming-tts') || contains(matrix.tests, 'zero-shot-zipvoice-tts') || contains(matrix.tests, 'zero-shot-pocket-tts') || contains(matrix.tests, 'supertonic-tts')
|
||||
with:
|
||||
name: tts-waves-${{ matrix.os }}-${{ matrix.arch }}
|
||||
path: tts-waves
|
||||
path: |
|
||||
go-api-examples/non-streaming-tts/*.wav
|
||||
go-api-examples/non-streaming-tts-phonemize/*.wav
|
||||
go-api-examples/offline-tts-play/*.wav
|
||||
go-api-examples/zero-shot-zipvoice-tts/*.wav
|
||||
go-api-examples/zero-shot-zipvoice-tts-play/*.wav
|
||||
go-api-examples/zero-shot-pocket-tts/*.wav
|
||||
go-api-examples/zero-shot-pocket-tts-play/*.wav
|
||||
go-api-examples/supertonic-tts/*.wav
|
||||
if-no-files-found: warn
|
||||
@@ -72,7 +72,12 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '>=1.17'
|
||||
# windows/arm64 needs Go >= 1.27: Go 1.26 cgo passes the MinGW-only
|
||||
# -mthreads flag, which clang rejects when it targets
|
||||
# aarch64-pc-windows-msvc (the ABI used to link the MSVC-built
|
||||
# sherpa-onnx-c-api.dll). Go 1.27 passes -pthread instead.
|
||||
# Other platforms keep the flexible spec.
|
||||
go-version: ${{ matrix.os == 'windows-11-arm' && '1.27.x' || '>=1.17' }}
|
||||
|
||||
- name: Set GOARCH for x86
|
||||
if: matrix.os == 'windows-2022' && matrix.arch == 'x86'
|
||||
@@ -238,7 +243,7 @@ jobs:
|
||||
- os: macos-latest
|
||||
arch: arm64
|
||||
index: 3
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts streaming-decode-files"
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts non-streaming-tts-phonemize streaming-decode-files"
|
||||
- os: macos-latest
|
||||
arch: arm64
|
||||
index: 4
|
||||
@@ -250,7 +255,7 @@ jobs:
|
||||
- os: macos-latest
|
||||
arch: arm64
|
||||
index: 6
|
||||
tests: "add-punctuation-online non-streaming-speaker-diarization streaming-hlg-decoding"
|
||||
tests: "add-punctuation-online non-streaming-speaker-diarization streaming-hlg-decoding offline-zipformer-ctc-hlg"
|
||||
- os: macos-latest
|
||||
arch: arm64
|
||||
index: 7
|
||||
@@ -275,7 +280,7 @@ jobs:
|
||||
- os: macos-15-intel
|
||||
arch: amd64
|
||||
index: 3
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts streaming-decode-files"
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts non-streaming-tts-phonemize streaming-decode-files"
|
||||
- os: macos-15-intel
|
||||
arch: amd64
|
||||
index: 4
|
||||
@@ -287,7 +292,7 @@ jobs:
|
||||
- os: macos-15-intel
|
||||
arch: amd64
|
||||
index: 6
|
||||
tests: "add-punctuation-online non-streaming-speaker-diarization streaming-hlg-decoding"
|
||||
tests: "add-punctuation-online non-streaming-speaker-diarization streaming-hlg-decoding offline-zipformer-ctc-hlg"
|
||||
- os: macos-15-intel
|
||||
arch: amd64
|
||||
index: 7
|
||||
@@ -312,7 +317,7 @@ jobs:
|
||||
- os: ubuntu-latest
|
||||
arch: amd64
|
||||
index: 3
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts streaming-decode-files"
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts non-streaming-tts-phonemize streaming-decode-files"
|
||||
- os: ubuntu-latest
|
||||
arch: amd64
|
||||
index: 4
|
||||
@@ -324,7 +329,7 @@ jobs:
|
||||
- os: ubuntu-latest
|
||||
arch: amd64
|
||||
index: 6
|
||||
tests: "add-punctuation-online non-streaming-speaker-diarization streaming-hlg-decoding"
|
||||
tests: "add-punctuation-online non-streaming-speaker-diarization streaming-hlg-decoding offline-zipformer-ctc-hlg"
|
||||
- os: ubuntu-latest
|
||||
arch: amd64
|
||||
index: 7
|
||||
@@ -349,7 +354,7 @@ jobs:
|
||||
- os: ubuntu-22.04-arm
|
||||
arch: arm64
|
||||
index: 3
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts streaming-decode-files"
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts non-streaming-tts-phonemize streaming-decode-files"
|
||||
- os: ubuntu-22.04-arm
|
||||
arch: arm64
|
||||
index: 4
|
||||
@@ -361,7 +366,7 @@ jobs:
|
||||
- os: ubuntu-22.04-arm
|
||||
arch: arm64
|
||||
index: 6
|
||||
tests: "add-punctuation-online non-streaming-speaker-diarization streaming-hlg-decoding"
|
||||
tests: "add-punctuation-online non-streaming-speaker-diarization streaming-hlg-decoding offline-zipformer-ctc-hlg"
|
||||
- os: ubuntu-22.04-arm
|
||||
arch: arm64
|
||||
index: 7
|
||||
@@ -386,7 +391,7 @@ jobs:
|
||||
- os: windows-2022
|
||||
arch: x64
|
||||
index: 3
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts streaming-decode-files"
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts non-streaming-tts-phonemize streaming-decode-files"
|
||||
- os: windows-2022
|
||||
arch: x64
|
||||
index: 4
|
||||
@@ -398,7 +403,7 @@ jobs:
|
||||
- os: windows-2022
|
||||
arch: x64
|
||||
index: 6
|
||||
tests: "add-punctuation-online non-streaming-speaker-diarization streaming-hlg-decoding"
|
||||
tests: "add-punctuation-online non-streaming-speaker-diarization streaming-hlg-decoding offline-zipformer-ctc-hlg"
|
||||
- os: windows-2022
|
||||
arch: x64
|
||||
index: 7
|
||||
@@ -423,7 +428,7 @@ jobs:
|
||||
- os: windows-2022
|
||||
arch: x86
|
||||
index: 3
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts streaming-decode-files"
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts non-streaming-tts-phonemize streaming-decode-files"
|
||||
- os: windows-2022
|
||||
arch: x86
|
||||
index: 4
|
||||
@@ -435,7 +440,7 @@ jobs:
|
||||
- os: windows-2022
|
||||
arch: x86
|
||||
index: 6
|
||||
tests: "add-punctuation-online non-streaming-speaker-diarization streaming-hlg-decoding"
|
||||
tests: "add-punctuation-online non-streaming-speaker-diarization streaming-hlg-decoding offline-zipformer-ctc-hlg"
|
||||
- os: windows-2022
|
||||
arch: x86
|
||||
index: 7
|
||||
@@ -460,7 +465,7 @@ jobs:
|
||||
- os: windows-11-arm
|
||||
arch: arm64
|
||||
index: 3
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts streaming-decode-files"
|
||||
tests: "non-streaming-medasr-ctc-decode-files non-streaming-omnilingual-asr-ctc-decode-files non-streaming-tts non-streaming-tts-phonemize streaming-decode-files"
|
||||
- os: windows-11-arm
|
||||
arch: arm64
|
||||
index: 4
|
||||
@@ -472,7 +477,7 @@ jobs:
|
||||
- os: windows-11-arm
|
||||
arch: arm64
|
||||
index: 6
|
||||
tests: "add-punctuation-online non-streaming-speaker-diarization streaming-hlg-decoding"
|
||||
tests: "add-punctuation-online non-streaming-speaker-diarization streaming-hlg-decoding offline-zipformer-ctc-hlg"
|
||||
- os: windows-11-arm
|
||||
arch: arm64
|
||||
index: 7
|
||||
@@ -487,7 +492,12 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '>=1.17'
|
||||
# windows/arm64 needs Go >= 1.27: Go 1.26 cgo passes the MinGW-only
|
||||
# -mthreads flag, which clang rejects when it targets
|
||||
# aarch64-pc-windows-msvc (the ABI used to link the MSVC-built
|
||||
# sherpa-onnx-c-api.dll). Go 1.27 passes -pthread instead.
|
||||
# Other platforms keep the flexible spec.
|
||||
go-version: ${{ matrix.os == 'windows-11-arm' && '1.27.x' || '>=1.17' }}
|
||||
|
||||
- name: Set up MinGW for x86
|
||||
if: matrix.os == 'windows-2022' && matrix.arch == 'x86'
|
||||
@@ -537,3 +547,18 @@ jobs:
|
||||
.github/scripts/go/${test}.sh
|
||||
echo "=== ${test} passed ==="
|
||||
done
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: contains(matrix.tests, 'non-streaming-tts') || contains(matrix.tests, 'zero-shot-zipvoice-tts') || contains(matrix.tests, 'zero-shot-pocket-tts') || contains(matrix.tests, 'supertonic-tts')
|
||||
with:
|
||||
name: tts-waves-${{ matrix.os }}-${{ matrix.arch }}
|
||||
path: |
|
||||
go-api-examples/non-streaming-tts/*.wav
|
||||
go-api-examples/non-streaming-tts-phonemize/*.wav
|
||||
go-api-examples/offline-tts-play/*.wav
|
||||
go-api-examples/zero-shot-zipvoice-tts/*.wav
|
||||
go-api-examples/zero-shot-zipvoice-tts-play/*.wav
|
||||
go-api-examples/zero-shot-pocket-tts/*.wav
|
||||
go-api-examples/zero-shot-pocket-tts-play/*.wav
|
||||
go-api-examples/supertonic-tts/*.wav
|
||||
if-no-files-found: warn
|
||||
@@ -168,4 +168,21 @@ jobs:
|
||||
cp -v scripts/node-addon-api/lib/*.js $d/
|
||||
cp -v ./build/install/lib/lib* $d/
|
||||
|
||||
# piper-phonemize-node (and the other example deps) come from npm
|
||||
(cd $d && npm install)
|
||||
|
||||
# ...but the tests must run against the addon we just built: npm
|
||||
# install also brings in sherpa-onnx-node with a prebuilt
|
||||
# sherpa-onnx-<platform> binary, and addon.js looks in
|
||||
# node_modules/ before ./sherpa-onnx.node. Drop those so the
|
||||
# freshly built ./sherpa-onnx.node copied above is used.
|
||||
rm -rf $d/node_modules/sherpa-onnx-*
|
||||
|
||||
.github/scripts/test-nodejs-addon-npm.sh
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tts-waves-${{ matrix.os }}-${{ matrix.node-version }}
|
||||
path: |
|
||||
nodejs-addon-examples/test-*-lexicon.wav
|
||||
nodejs-addon-examples/test-*-phonemize.wav
|
||||
if-no-files-found: warn
|
||||
@@ -75,3 +75,10 @@ jobs:
|
||||
cd ../
|
||||
|
||||
.github/scripts/test-nodejs-addon-npm.sh
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tts-waves-${{ matrix.os }}-${{ matrix.node-version }}
|
||||
path: |
|
||||
nodejs-addon-examples/test-*-lexicon.wav
|
||||
nodejs-addon-examples/test-*-phonemize.wav
|
||||
if-no-files-found: warn
|
||||
@@ -3,15 +3,6 @@ name: test-nodejs-npm
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
schedule:
|
||||
# minute (0-59)
|
||||
# hour (0-23)
|
||||
# day of the month (1-31)
|
||||
# month (1-12)
|
||||
# day of the week (0-6)
|
||||
# nightly build at 23:50 UTC time every day
|
||||
- cron: "50 23 * * *"
|
||||
|
||||
concurrency:
|
||||
group: test-nodejs-npm-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
@@ -63,3 +54,10 @@ jobs:
|
||||
|
||||
export d=nodejs-examples
|
||||
./.github/scripts/test-nodejs-npm.sh
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tts-waves-${{ matrix.os }}-${{ matrix.node-version }}
|
||||
# all TTS outputs: *-lexicon.wav, *-phonemize.wav, plus the
|
||||
# own-frontend models (test-pocket-en.wav, test-supertonic-*.wav)
|
||||
path: nodejs-examples/test-*.wav
|
||||
if-no-files-found: warn
|
||||
@@ -113,9 +113,18 @@ jobs:
|
||||
pushd $d
|
||||
npm install
|
||||
npm install wav
|
||||
npm install piper-phonemize
|
||||
popd
|
||||
|
||||
./.github/scripts/test-nodejs-npm.sh
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tts-waves-${{ matrix.os }}-${{ matrix.node-version }}
|
||||
# The examples are copied into scripts/nodejs and run from there
|
||||
# (export d=scripts/nodejs), so their wavs land in scripts/nodejs,
|
||||
# not in nodejs-examples.
|
||||
path: scripts/nodejs/test-*.wav
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Setup tmate session
|
||||
if: false
|
||||
|
||||
@@ -94,11 +94,6 @@ jobs:
|
||||
ls -lh bin
|
||||
|
||||
file ./bin/sherpa-onnx
|
||||
|
||||
rm -fv ./install/include/cargs.h
|
||||
rm -fv ./install/lib/cargs.h
|
||||
rm -fv ./install/lib/libcargs.dylib
|
||||
rm -fv ./install/lib/libcargs.a
|
||||
rm -rfv ./install/lib/pkgconfig
|
||||
|
||||
- name: Display dependencies of sherpa-onnx for macos
|
||||
|
||||
@@ -3,15 +3,7 @@ name: test-pip-install
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- test-pip-install
|
||||
schedule:
|
||||
# minute (0-59)
|
||||
# hour (0-23)
|
||||
# day of the month (1-31)
|
||||
# month (1-12)
|
||||
# day of the week (0-6)
|
||||
# nightly build at 23:50 UTC time every day
|
||||
- cron: "50 23 * * *"
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
name: test-piper-phonemize
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-piper-phonemize.yaml'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: test-piper-phonemize-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test_piper_phonemize:
|
||||
name: ${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.shared_lib }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-2022]
|
||||
build_type: [Release, Debug]
|
||||
shared_lib: [ON, OFF]
|
||||
exclude:
|
||||
- os: windows-2022
|
||||
build_type: Debug
|
||||
shared_lib: OFF
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
run: |
|
||||
./new-release.sh
|
||||
git diff .
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ matrix.os }}-${{ matrix.build_type }}-shared-${{ matrix.shared_lib }}
|
||||
|
||||
- name: Configure CMake
|
||||
shell: bash
|
||||
run: |
|
||||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
cmake --version
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DSHERPA_ONNX_ENABLE_EPSEAK_NG_EXE=ON -DBUILD_ESPEAK_NG_EXE=ON -DCMAKE_VERBOSE_MAKEFILE=ON -D SHERPA_ONNX_ENABLE_TESTS=ON -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} -DCMAKE_INSTALL_PREFIX=./install ..
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: |
|
||||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
cmake --version
|
||||
|
||||
cd build
|
||||
cmake --build . --target install --config ${{ matrix.build_type }}
|
||||
|
||||
- name: run test
|
||||
if: matrix.os != 'windows-2022'
|
||||
shell: bash
|
||||
run: |
|
||||
cd build
|
||||
|
||||
ls -lh install/
|
||||
ls -lh install/share
|
||||
ls -lh install/share/espeak-ng-data/
|
||||
|
||||
./bin/piper-phonemize-test
|
||||
|
||||
- name: run test
|
||||
if: matrix.os == 'windows-2022'
|
||||
shell: bash
|
||||
run: |
|
||||
cd build
|
||||
|
||||
ls -lh install/
|
||||
ls -lh install/share
|
||||
ls -lh install/share/espeak-ng-data/
|
||||
|
||||
./bin/${{ matrix.build_type }}/piper-phonemize-test
|
||||
@@ -156,6 +156,12 @@ jobs:
|
||||
run: |
|
||||
./.github/scripts/test-rust-shared.sh
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tts-waves-${{ matrix.os }}-${{ matrix.lib_setup }}
|
||||
path: rust-api-examples/generated-*-rust.wav
|
||||
if-no-files-found: warn
|
||||
|
||||
termux:
|
||||
name: Termux ${{ matrix.arch }} (${{ matrix.lib_setup }})
|
||||
runs-on: ${{ matrix.runner }}
|
||||
@@ -255,7 +261,6 @@ jobs:
|
||||
--volume ${{ github.workspace }}/:/k2-fsa/sherpa-onnx \
|
||||
--volume /tmp/sherpa-onnx-android-archive:/archive \
|
||||
--volume /tmp/sherpa-onnx-android-lib:/lib \
|
||||
-e LIB_SETUP \
|
||||
-e SHERPA_ONNX_LIB_DIR \
|
||||
-e SHERPA_ONNX_ARCHIVE_DIR \
|
||||
termux/termux-docker:${{ matrix.arch }} \
|
||||
@@ -276,27 +281,28 @@ jobs:
|
||||
|
||||
cd /k2-fsa/sherpa-onnx
|
||||
|
||||
# Detect and set library paths based on available directories
|
||||
# Detect and set library paths based on available directories.
|
||||
#
|
||||
# NOTE: the termux/termux-docker image does NOT pass -e environment
|
||||
# variables into the container (verified: they arrive unset), so we
|
||||
# must detect the library location by path here instead of
|
||||
# receiving it from the host.
|
||||
#
|
||||
# This matters because sherpa-onnx-sys's build.rs silently falls
|
||||
# back to downloading the *released* prebuilt libraries from GitHub
|
||||
# when SHERPA_ONNX_LIB_DIR/SHERPA_ONNX_ARCHIVE_DIR are unset. For
|
||||
# branches under test those prebuilt libs have older C struct
|
||||
# layouts than the local checkout, so the examples crash with a
|
||||
# wild-pointer SIGSEGV. Watch the "[build.rs]" cargo:warning lines
|
||||
# in the log to confirm which library directory was picked up.
|
||||
echo "=== Detecting library setup ==="
|
||||
|
||||
# Detect Android ABI based on architecture
|
||||
ARCH=$(uname -m)
|
||||
case "$ARCH" in
|
||||
aarch64|arm64)
|
||||
ABI="arm64-v8a"
|
||||
;;
|
||||
armv7*|armv8l)
|
||||
ABI="armeabi-v7a"
|
||||
;;
|
||||
x86_64)
|
||||
ABI="x86_64"
|
||||
;;
|
||||
i*86)
|
||||
ABI="x86"
|
||||
;;
|
||||
*)
|
||||
ABI="arm64-v8a" # default
|
||||
;;
|
||||
aarch64|arm64) ABI="arm64-v8a" ;;
|
||||
armv7*|armv8l) ABI="armeabi-v7a" ;;
|
||||
x86_64) ABI="x86_64" ;;
|
||||
i*86) ABI="x86" ;;
|
||||
*) ABI="arm64-v8a" ;;
|
||||
esac
|
||||
echo "Detected architecture: $ARCH -> ABI: $ABI"
|
||||
|
||||
@@ -304,12 +310,14 @@ jobs:
|
||||
echo "Found pre-extracted libs at /lib/jniLibs/$ABI"
|
||||
export SHERPA_ONNX_LIB_DIR=/lib/jniLibs/$ABI
|
||||
fi
|
||||
if ls /archive/*.tar.bz2 &>/dev/null; then
|
||||
if ls /archive/*.tar.bz2 >/dev/null 2>&1; then
|
||||
echo "Found archive at /archive"
|
||||
export SHERPA_ONNX_ARCHIVE_DIR=/archive
|
||||
fi
|
||||
|
||||
# Add sherpa-onnx library path if available
|
||||
echo "SHERPA_ONNX_LIB_DIR=${SHERPA_ONNX_LIB_DIR:-unset}"
|
||||
echo "SHERPA_ONNX_ARCHIVE_DIR=${SHERPA_ONNX_ARCHIVE_DIR:-unset}"
|
||||
|
||||
if [ -n "$SHERPA_ONNX_LIB_DIR" ]; then
|
||||
export LD_LIBRARY_PATH=$SHERPA_ONNX_LIB_DIR:$LD_LIBRARY_PATH
|
||||
fi
|
||||
@@ -335,3 +343,9 @@ jobs:
|
||||
# Run all tests (Android only supports shared linking)
|
||||
bash .github/scripts/test-rust-shared.sh
|
||||
'
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tts-waves-termux-${{ matrix.arch }}-${{ matrix.lib_setup }}
|
||||
path: rust-api-examples/generated-*-rust.wav
|
||||
if-no-files-found: warn
|
||||
@@ -33,12 +33,10 @@ jobs:
|
||||
with:
|
||||
key: ${{ matrix.os }}-rust-${{ matrix.link_mode }}
|
||||
|
||||
- name: Cache installed libs
|
||||
id: cache-libs
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: build/install
|
||||
key: rust-libs-${{ matrix.os }}-${{ matrix.link_mode }}-${{ hashFiles('CMakeLists.txt') }}
|
||||
# NOTE: caching build/install is disabled on purpose. The old cache key
|
||||
# only hashed CMakeLists.txt, so a struct/ABI change in c-api.h could
|
||||
# restore prebuilt libs that disagree with the Rust FFI structs and
|
||||
# crash at runtime. The libs are rebuilt from source every run.
|
||||
|
||||
- name: Update version
|
||||
shell: bash
|
||||
@@ -53,7 +51,6 @@ jobs:
|
||||
arch: ${{ matrix.os == 'windows-11-arm' && 'amd64_arm64' || 'x64' }}
|
||||
|
||||
- name: Configure sherpa-onnx
|
||||
if: steps.cache-libs.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
@@ -96,7 +93,6 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Build sherpa-onnx
|
||||
if: steps.cache-libs.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
@@ -262,6 +258,12 @@ jobs:
|
||||
./.github/scripts/test-rust-static.sh
|
||||
fi
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tts-waves-${{ matrix.os }}-${{ matrix.link_mode }}-${{ matrix.lib_setup }}
|
||||
path: rust-api-examples/generated-*-rust.wav
|
||||
if-no-files-found: warn
|
||||
|
||||
termux:
|
||||
name: Termux ${{ matrix.arch }} (${{ matrix.lib_setup }})
|
||||
runs-on: ${{ matrix.runner }}
|
||||
@@ -345,10 +347,6 @@ jobs:
|
||||
-DSHERPA_ONNX_ENABLE_TTS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=ON \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DBUILD_PIPER_PHONMIZE_EXE=OFF \
|
||||
-DBUILD_PIPER_PHONMIZE_TESTS=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DBUILD_ESPEAK_NG_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
|
||||
@@ -375,17 +373,62 @@ jobs:
|
||||
echo 'sherpa-onnx = { path = "../sherpa-onnx/rust/sherpa-onnx" }' >> rust-api-examples/.cargo/config.toml
|
||||
echo 'sherpa-onnx-sys = { path = "../sherpa-onnx/rust/sherpa-onnx-sys" }' >> rust-api-examples/.cargo/config.toml
|
||||
|
||||
- name: Prepare directories and stage libs (host)
|
||||
shell: bash
|
||||
env:
|
||||
LIB_SETUP: ${{ matrix.lib_setup }}
|
||||
run: |
|
||||
# Do all directory creation and file staging on the HOST:
|
||||
# * the Termux container cannot always create directories (read-only
|
||||
# bits of the filesystem / different uid than the build container);
|
||||
# * files created by the build container may not be writable by the
|
||||
# test container, hence chmod -R 777.
|
||||
# The container then only *detects* what the host prepared (see the
|
||||
# "Detecting library setup" comment in the Run Rust tests step).
|
||||
#
|
||||
# sudo is required: build/ was written by the build container under a
|
||||
# different uid, so the runner user cannot chmod it or create
|
||||
# directories inside it ("Operation not permitted"/"Permission denied").
|
||||
sudo chmod -R 777 "${{ github.workspace }}" || true
|
||||
mkdir -p "${{ github.workspace }}/rust-api-examples/target"
|
||||
chmod -R 777 "${{ github.workspace }}/rust-api-examples/target" || true
|
||||
|
||||
if [[ "$LIB_SETUP" == "archive_dir" ]]; then
|
||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d "\"" -f 2)
|
||||
# build.rs expects the archive to contain jniLibs/{abi}/ at its root
|
||||
sudo mkdir -p build/install/jniLibs/arm64-v8a
|
||||
sudo cp -v build/install/lib/*.so build/install/jniLibs/arm64-v8a/
|
||||
sudo chmod -R 777 build/install/jniLibs
|
||||
mkdir -p /tmp/sherpa-onnx-archive
|
||||
rm -f /tmp/sherpa-onnx-archive/sherpa-onnx-v${SHERPA_ONNX_VERSION}-android.tar.bz2
|
||||
tar cjf /tmp/sherpa-onnx-archive/sherpa-onnx-v${SHERPA_ONNX_VERSION}-android.tar.bz2 -C build/install jniLibs
|
||||
chmod -R 777 /tmp/sherpa-onnx-archive
|
||||
ls -lh /tmp/sherpa-onnx-archive/
|
||||
fi
|
||||
|
||||
- name: Run Rust tests in Termux
|
||||
shell: bash
|
||||
env:
|
||||
LIB_SETUP: ${{ matrix.lib_setup }}
|
||||
run: |
|
||||
# NOTE: the termux/termux-docker image does NOT pass -e environment
|
||||
# variables into the container (verified: both -e LIB_SETUP and
|
||||
# -e SHERPA_ONNX_LIB_DIR arrived unset). So the library location is
|
||||
# detected by path *inside* the container instead.
|
||||
#
|
||||
# This matters because sherpa-onnx-sys's build.rs silently falls
|
||||
# back to downloading the *released* prebuilt libraries from GitHub
|
||||
# when SHERPA_ONNX_LIB_DIR/SHERPA_ONNX_ARCHIVE_DIR are unset. Those
|
||||
# prebuilt libs have older C struct layouts than this checkout, so
|
||||
# the examples crash with a wild-pointer SIGSEGV. See the
|
||||
# "[build.rs]" cargo:warning lines in the log to confirm which
|
||||
# library directory was picked up.
|
||||
docker run --rm \
|
||||
--volume ${{ github.workspace }}/:/k2-fsa/sherpa-onnx \
|
||||
-e LIB_SETUP \
|
||||
--volume /tmp/sherpa-onnx-archive:/tmp/sherpa-onnx-archive \
|
||||
termux/termux-docker:${{ matrix.arch }} \
|
||||
bash -c '
|
||||
set -e
|
||||
set -ex
|
||||
|
||||
apt update -y
|
||||
apt install -y libc++ clang git
|
||||
@@ -400,23 +443,21 @@ jobs:
|
||||
|
||||
cd /k2-fsa/sherpa-onnx
|
||||
|
||||
# Set environment variables based on lib_setup mode
|
||||
if [ "$LIB_SETUP" = "lib_dir" ]; then
|
||||
# Set the library location by detecting which one the host prepared
|
||||
if [ -d /k2-fsa/sherpa-onnx/build/install/lib ]; then
|
||||
export SHERPA_ONNX_LIB_DIR=/k2-fsa/sherpa-onnx/build/install/lib
|
||||
elif [ "$LIB_SETUP" = "archive_dir" ]; then
|
||||
# Create an archive with the exact name build.rs expects for Android
|
||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d "\"" -f 2)
|
||||
mkdir -p /tmp/sherpa-onnx-archive
|
||||
cd build/install
|
||||
# Android archive name: sherpa-onnx-v{version}-android.tar.bz2
|
||||
# But we need jniLibs/{abi}/ structure, so create that
|
||||
mkdir -p jniLibs/arm64-v8a
|
||||
cp lib/*.so jniLibs/arm64-v8a/
|
||||
tar cjf /tmp/sherpa-onnx-archive/sherpa-onnx-v${SHERPA_ONNX_VERSION}-android.tar.bz2 jniLibs/
|
||||
cd /k2-fsa/sherpa-onnx
|
||||
elif ls /tmp/sherpa-onnx-archive/*.tar.bz2 >/dev/null 2>&1; then
|
||||
export SHERPA_ONNX_ARCHIVE_DIR=/tmp/sherpa-onnx-archive
|
||||
fi
|
||||
echo "SHERPA_ONNX_LIB_DIR=${SHERPA_ONNX_LIB_DIR:-unset}"
|
||||
echo "SHERPA_ONNX_ARCHIVE_DIR=${SHERPA_ONNX_ARCHIVE_DIR:-unset}"
|
||||
|
||||
# Run all tests (Android only supports shared linking)
|
||||
bash .github/scripts/test-rust-shared.sh
|
||||
'
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tts-waves-termux-${{ matrix.arch }}-${{ matrix.lib_setup }}
|
||||
path: rust-api-examples/generated-*-rust.wav
|
||||
if-no-files-found: warn
|
||||
@@ -67,7 +67,6 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=$build_shared \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
@@ -395,7 +394,6 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=$build_shared \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
@@ -550,7 +548,6 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=$build_shared \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
@@ -560,7 +557,6 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=$build_shared \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
|
||||
@@ -3,15 +3,7 @@ name: test-uv-install
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- test-uv-install
|
||||
schedule:
|
||||
# minute (0-59)
|
||||
# hour (0-23)
|
||||
# day of the month (1-31)
|
||||
# month (1-12)
|
||||
# day of the week (0-6)
|
||||
# nightly build at 23:50 UTC time every day
|
||||
- cron: "50 23 * * *"
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -178,4 +170,4 @@ jobs:
|
||||
uv run sherpa-onnx-offline-websocket-server --help
|
||||
|
||||
uv run sherpa-onnx-online-websocket-server --help
|
||||
uv run sherpa-onnx-online-websocket-client --help
|
||||
uv run sherpa-onnx-online-websocket-client --help
|
||||
@@ -86,7 +86,7 @@ jobs:
|
||||
file: ./*.tar.bz2
|
||||
# repo_name: k2-fsa/sherpa-onnx
|
||||
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
# tag: v1.10.46
|
||||
# tag: v1.13.8
|
||||
|
||||
- name: Release
|
||||
if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||
|
||||
@@ -93,7 +93,7 @@ jobs:
|
||||
file: ./*.tar.bz2
|
||||
# repo_name: k2-fsa/sherpa-onnx
|
||||
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
# tag: v1.10.23
|
||||
# tag: v1.13.8
|
||||
|
||||
- name: Upload wasm files
|
||||
uses: actions/upload-artifact@v4
|
||||
|
||||
@@ -50,7 +50,6 @@ jobs:
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_C_API=OFF \
|
||||
|
||||
@@ -73,7 +73,6 @@ jobs:
|
||||
-D SHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} \
|
||||
-D CMAKE_INSTALL_PREFIX=./install \
|
||||
-D BUILD_ESPEAK_NG_EXE=OFF \
|
||||
..
|
||||
|
||||
- name: Check 1
|
||||
@@ -198,8 +197,6 @@ jobs:
|
||||
fi
|
||||
|
||||
rm -rf $dst/lib/pkgconfig
|
||||
rm -f $dst/lib/cargs.dll $dst/lib/cargs.lib $dst/lib/cargs.h
|
||||
rm -f $dst/include/cargs.h
|
||||
|
||||
ls -lh $dst/bin/
|
||||
echo "---"
|
||||
@@ -212,10 +209,8 @@ jobs:
|
||||
if [[ $shared_lib == "ON" ]]; then
|
||||
cp -av build/install/lib/*.dll ${lib_dst}/lib/
|
||||
cp -av build/install/lib/*.lib ${lib_dst}/lib/
|
||||
rm -f ${lib_dst}/lib/cargs.dll ${lib_dst}/lib/cargs.lib
|
||||
else
|
||||
cp -av build/install/lib/*.lib ${lib_dst}/lib/
|
||||
rm -f ${lib_dst}/lib/cargs.lib
|
||||
fi
|
||||
ls -lh ${lib_dst}/lib/
|
||||
tar cjvf ${lib_dst}.tar.bz2 ${lib_dst}
|
||||
@@ -224,6 +219,15 @@ jobs:
|
||||
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
# The PDB debug symbols (~200 MB each) are already inside the release
|
||||
# tarballs above. The loose copies in build/ and build/install are only
|
||||
# needed for debugging a crash locally, not for running CI tests, so
|
||||
# drop them here to free several GB for the publish/test steps below.
|
||||
rm -f build/bin/${{ matrix.build_type }}/*.pdb
|
||||
rm -f build/install/bin/*.pdb
|
||||
echo "Freed PDB files. Disk now:"
|
||||
df -h .
|
||||
|
||||
# https://huggingface.co/docs/hub/spaces-github-actions
|
||||
- name: Publish to huggingface
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
|
||||
@@ -267,7 +271,7 @@ jobs:
|
||||
file: sherpa-onnx-*-win-arm64*.tar.bz2
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: v1.12.28
|
||||
tag: v1.13.8
|
||||
|
||||
- name: Release pre-compiled binaries and libs for Windows arm64
|
||||
if: github.repository_owner == 'k2-fsa'&& github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||
@@ -277,6 +281,28 @@ jobs:
|
||||
overwrite: true
|
||||
file: sherpa-onnx-*-win-arm64*.tar.bz2
|
||||
|
||||
# The release artifacts, the huggingface clone and the RelWithDebInfo/Debug
|
||||
# PDB files are no longer needed once we get here (the Release steps above
|
||||
# are tag-only and are skipped for branch builds). Windows arm64 runners
|
||||
# have limited disk, and the tests below each download large ASR models,
|
||||
# so free that space first or the model extraction fails with "no space
|
||||
# left on device". Only the test binaries in build/bin/<build_type> and
|
||||
# the shared libs they load are kept.
|
||||
- name: Free disk space before tests
|
||||
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Disk space before cleanup:"
|
||||
df -h .
|
||||
rm -rf huggingface
|
||||
rm -rf sherpa-onnx-*-win-arm64*/
|
||||
rm -f sherpa-onnx-*-win-arm64*.tar.bz2
|
||||
rm -f build/bin/${{ matrix.build_type }}/*.pdb
|
||||
rm -f build/install/bin/*.pdb
|
||||
rm -rf build/install/share build/install/lib/pkgconfig
|
||||
echo "Disk space after cleanup:"
|
||||
df -h .
|
||||
|
||||
- name: Test offline Cohere Transcribe for windows arm64
|
||||
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||
shell: bash
|
||||
|
||||
@@ -50,7 +50,6 @@ jobs:
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_C_API=OFF \
|
||||
|
||||
@@ -73,7 +73,6 @@ jobs:
|
||||
-D SHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} \
|
||||
-D CMAKE_INSTALL_PREFIX=./install \
|
||||
-D BUILD_ESPEAK_NG_EXE=OFF \
|
||||
..
|
||||
|
||||
- name: Check 1
|
||||
@@ -198,8 +197,6 @@ jobs:
|
||||
fi
|
||||
|
||||
rm -rf $dst/lib/pkgconfig
|
||||
rm -f $dst/lib/cargs.dll $dst/lib/cargs.lib $dst/lib/cargs.h
|
||||
rm -f $dst/include/cargs.h
|
||||
|
||||
ls -lh $dst/bin/
|
||||
echo "---"
|
||||
@@ -212,10 +209,8 @@ jobs:
|
||||
if [[ $shared_lib == "ON" ]]; then
|
||||
cp -av build/install/lib/*.dll ${lib_dst}/lib/
|
||||
cp -av build/install/lib/*.lib ${lib_dst}/lib/
|
||||
rm -f ${lib_dst}/lib/cargs.dll ${lib_dst}/lib/cargs.lib
|
||||
else
|
||||
cp -av build/install/lib/*.lib ${lib_dst}/lib/
|
||||
rm -f ${lib_dst}/lib/cargs.lib
|
||||
fi
|
||||
ls -lh ${lib_dst}/lib/
|
||||
tar cjvf ${lib_dst}.tar.bz2 ${lib_dst}
|
||||
@@ -224,6 +219,15 @@ jobs:
|
||||
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
# The PDB debug symbols (~200 MB each) are already inside the release
|
||||
# tarballs above. The loose copies in build/ and build/install are only
|
||||
# needed for debugging a crash locally, not for running CI tests, so
|
||||
# drop them here to free several GB for the publish/test steps below.
|
||||
rm -f build/bin/${{ matrix.build_type }}/*.pdb
|
||||
rm -f build/install/bin/*.pdb
|
||||
echo "Freed PDB files. Disk now:"
|
||||
df -h .
|
||||
|
||||
# https://huggingface.co/docs/hub/spaces-github-actions
|
||||
- name: Publish to huggingface
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
|
||||
@@ -267,7 +271,7 @@ jobs:
|
||||
file: sherpa-onnx-*-win-x64*.tar.bz2
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: v1.12.31
|
||||
tag: v1.13.8
|
||||
|
||||
- name: Release pre-compiled binaries and libs for Windows x64
|
||||
if: github.repository_owner == 'k2-fsa'&& github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||
|
||||
@@ -68,7 +68,6 @@ jobs:
|
||||
-D SHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} \
|
||||
-D CMAKE_INSTALL_PREFIX=./install \
|
||||
-D BUILD_ESPEAK_NG_EXE=OFF \
|
||||
..
|
||||
|
||||
- name: Check 1
|
||||
@@ -190,8 +189,6 @@ jobs:
|
||||
fi
|
||||
|
||||
rm -rf $dst/lib/pkgconfig
|
||||
rm -f $dst/lib/cargs.dll $dst/lib/cargs.lib $dst/lib/cargs.h
|
||||
rm -f $dst/include/cargs.h
|
||||
|
||||
ls -lh $dst/bin/
|
||||
echo "---"
|
||||
@@ -204,10 +201,8 @@ jobs:
|
||||
if [[ $shared_lib == "ON" ]]; then
|
||||
cp -av build/install/lib/*.dll ${lib_dst}/lib/
|
||||
cp -av build/install/lib/*.lib ${lib_dst}/lib/
|
||||
rm -f ${lib_dst}/lib/cargs.dll ${lib_dst}/lib/cargs.lib
|
||||
else
|
||||
cp -av build/install/lib/*.lib ${lib_dst}/lib/
|
||||
rm -f ${lib_dst}/lib/cargs.lib
|
||||
fi
|
||||
ls -lh ${lib_dst}/lib/
|
||||
tar cjvf ${lib_dst}.tar.bz2 ${lib_dst}
|
||||
@@ -216,6 +211,15 @@ jobs:
|
||||
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
# The PDB debug symbols (~200 MB each) are already inside the release
|
||||
# tarballs above. The loose copies in build/ and build/install are only
|
||||
# needed for debugging a crash locally, not for running CI tests, so
|
||||
# drop them here to free several GB for the publish/test steps below.
|
||||
rm -f build/bin/${{ matrix.build_type }}/*.pdb
|
||||
rm -f build/install/bin/*.pdb
|
||||
echo "Freed PDB files. Disk now:"
|
||||
df -h .
|
||||
|
||||
# https://huggingface.co/docs/hub/spaces-github-actions
|
||||
- name: Publish to huggingface
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
|
||||
@@ -259,7 +263,7 @@ jobs:
|
||||
file: sherpa-onnx-*-win-x86*.tar.bz2
|
||||
repo_name: k2-fsa/sherpa-onnx
|
||||
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
tag: v1.12.28
|
||||
tag: v1.13.8
|
||||
|
||||
- name: Release pre-compiled binaries and libs for Windows x86
|
||||
if: github.repository_owner == 'k2-fsa'&& github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||
|
||||
@@ -192,9 +192,15 @@ sherpa-onnx-qwen3-asr-0.6B-int8-2026-03-25
|
||||
sherpa-onnx-spleeter-2stems-fp16
|
||||
sherpa-onnx-cohere-transcribe-14-lang-int8-2026-04-01
|
||||
espeak-ng-data
|
||||
# downloaded piper-phonemize wasm bundle for the TTS web demo; see
|
||||
# wasm/tts/assets/README.md
|
||||
wasm/tts/piper-phonemize/
|
||||
sherpa-onnx-nemo*
|
||||
kokoro-int8-en-v0_19
|
||||
vits-inflect-*-v2
|
||||
assets-2
|
||||
swiftpm
|
||||
.sherpa-onnx-xcframework-version
|
||||
lexicon*.txt
|
||||
tts.json
|
||||
*.bin
|
||||
@@ -566,13 +566,6 @@ endif()
|
||||
|
||||
include(json)
|
||||
|
||||
if(SHERPA_ONNX_ENABLE_TTS)
|
||||
include(espeak-ng-for-piper)
|
||||
set(ESPEAK_NG_DIR ${espeak_ng_SOURCE_DIR})
|
||||
message(STATUS "ESPEAK_NG_DIR: ${ESPEAK_NG_DIR}")
|
||||
include(piper-phonemize)
|
||||
endif()
|
||||
|
||||
if(SHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION)
|
||||
include(hclust-cpp)
|
||||
endif()
|
||||
@@ -607,7 +600,6 @@ endif()
|
||||
add_subdirectory(sherpa-onnx)
|
||||
|
||||
if(SHERPA_ONNX_ENABLE_C_API AND SHERPA_ONNX_ENABLE_BINARY AND SHERPA_ONNX_BUILD_C_API_EXAMPLES)
|
||||
set(SHERPA_ONNX_PKG_WITH_CARGS "-lcargs")
|
||||
add_subdirectory(c-api-examples)
|
||||
add_subdirectory(cxx-api-examples)
|
||||
endif()
|
||||
|
||||
+14
-14
@@ -88,15 +88,15 @@ let package = Package(
|
||||
"spoken-language-identification.swift",
|
||||
"streaming-hlg-decode-file.swift",
|
||||
"test-version.swift",
|
||||
"tts-kitten-en.swift",
|
||||
"tts-kokoro-en.swift",
|
||||
"tts-kokoro-zh-en.swift",
|
||||
"tts-matcha-en.swift",
|
||||
"tts-matcha-zh.swift",
|
||||
"tts-kitten-en-lexicon.swift",
|
||||
"tts-kokoro-en-lexicon.swift",
|
||||
"tts-kokoro-zh-en-lexicon.swift",
|
||||
"tts-matcha-en-lexicon.swift",
|
||||
"tts-matcha-zh-lexicon.swift",
|
||||
"tts-pocket-en.swift",
|
||||
"tts-supertonic-en.swift",
|
||||
"tts-vits.swift",
|
||||
"tts-zipvoice.swift",
|
||||
"tts-vits-lexicon.swift",
|
||||
"tts-zipvoice-lexicon.swift",
|
||||
"wenet-ctc-asr.swift",
|
||||
"zipformer-ctc-asr.swift",
|
||||
"run-add-punctuations-online.sh",
|
||||
@@ -128,15 +128,15 @@ let package = Package(
|
||||
"run-spoken-language-identification.sh",
|
||||
"run-streaming-hlg-decode-file.sh",
|
||||
"run-test-version.sh",
|
||||
"run-tts-kitten-en.sh",
|
||||
"run-tts-kokoro-en.sh",
|
||||
"run-tts-kokoro-zh-en.sh",
|
||||
"run-tts-matcha-en.sh",
|
||||
"run-tts-matcha-zh.sh",
|
||||
"run-tts-kitten-en-lexicon.sh",
|
||||
"run-tts-kokoro-en-lexicon.sh",
|
||||
"run-tts-kokoro-zh-en-lexicon.sh",
|
||||
"run-tts-matcha-en-lexicon.sh",
|
||||
"run-tts-matcha-zh-lexicon.sh",
|
||||
"run-tts-pocket-en.sh",
|
||||
"run-tts-supertonic-en.sh",
|
||||
"run-tts-vits.sh",
|
||||
"run-tts-zipvoice.sh",
|
||||
"run-tts-vits-lexicon.sh",
|
||||
"run-tts-zipvoice-lexicon.sh",
|
||||
"run-wenet-ctc-asr.sh",
|
||||
"run-zipformer-ctc-asr.sh",
|
||||
],
|
||||
|
||||
@@ -38,6 +38,8 @@ dependencies {
|
||||
implementation 'androidx.core:core-ktx:1.7.0'
|
||||
implementation 'com.google.android.material:material:1.9.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
// piper-phonemize provides the text frontend for models without a lexicon
|
||||
implementation 'com.github.csukuangfj.piper-phonemize:piper-phonemize:v1.5.8'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
|
||||
Loaded 100 of 645 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user