Fix releasing go packages (#476)
This commit is contained in:
29
.github/workflows/build-wheels-aarch64.yaml
vendored
29
.github/workflows/build-wheels-aarch64.yaml
vendored
@@ -50,6 +50,35 @@ jobs:
|
||||
|
||||
ls -lh ./wheelhouse/*.whl
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: matrix.python-version == 'cp38'
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
uses: nick-fields/retry@v2
|
||||
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
|
||||
|
||||
git clone https://huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface
|
||||
cd huggingface
|
||||
git fetch
|
||||
git pull
|
||||
git merge -m "merge remote" --ff origin main
|
||||
|
||||
cp -v ../wheelhouse/*.whl .
|
||||
|
||||
git status
|
||||
git add .
|
||||
git commit -m "add more wheels"
|
||||
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: ./wheelhouse/*.whl
|
||||
|
||||
29
.github/workflows/build-wheels-armv7l.yaml
vendored
29
.github/workflows/build-wheels-armv7l.yaml
vendored
@@ -83,6 +83,35 @@ jobs:
|
||||
run: |
|
||||
ls -lh ./wheelhouse/
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: matrix.python-version == '3.8'
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
uses: nick-fields/retry@v2
|
||||
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
|
||||
|
||||
git clone https://huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface
|
||||
cd huggingface
|
||||
git fetch
|
||||
git pull
|
||||
git merge -m "merge remote" --ff origin main
|
||||
|
||||
cp -v ../wheelhouse/*.whl .
|
||||
|
||||
git status
|
||||
git add .
|
||||
git commit -m "add more wheels"
|
||||
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main
|
||||
|
||||
- name: Upload wheel
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
185
.github/workflows/release-go.yaml
vendored
185
.github/workflows/release-go.yaml
vendored
@@ -6,152 +6,15 @@ on:
|
||||
- '*'
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "Version information(e.g., v1.5.3) or auto"
|
||||
required: true
|
||||
|
||||
env:
|
||||
VERSION:
|
||||
|- # Enter release tag name or version name in workflow_dispatch. Appropriate version if not specified
|
||||
${{ github.event.release.tag_name || github.event.inputs.version }}
|
||||
|
||||
concurrency:
|
||||
group: release-go-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
linux-x86_64_wheel:
|
||||
if: github.repository_owner == 'k2-fsa' || github.repository_owner == 'csukuangfj'
|
||||
name: Linux x86_64
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: SSH to GitHub
|
||||
run: |
|
||||
mkdir -p ~/.ssh/
|
||||
cp scripts/go/ssh_config ~/.ssh/config
|
||||
echo "${{ secrets.MY_GITHUB_SSH_KEY }}" > ~/.ssh/github && chmod 600 ~/.ssh/github
|
||||
ssh github.com || true
|
||||
rm ~/.ssh/github
|
||||
|
||||
# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
|
||||
# for a list of versions
|
||||
- name: Build wheels
|
||||
uses: pypa/cibuildwheel@v2.11.4
|
||||
env:
|
||||
CIBW_BEFORE_BUILD: "pip install -U cmake numpy"
|
||||
CIBW_BUILD: "cp38-*64"
|
||||
CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686"
|
||||
CIBW_BUILD_VERBOSITY: 3
|
||||
CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH='/project/build/bdist.linux-x86_64/wheel/sherpa_onnx/lib'
|
||||
|
||||
- name: Display wheels
|
||||
shell: bash
|
||||
run: |
|
||||
ls -lh ./wheelhouse/*.whl
|
||||
unzip -l ./wheelhouse/*.whl
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.os }}-wheels-for-go
|
||||
path: ./wheelhouse/*.whl
|
||||
|
||||
macOS:
|
||||
name: macOS ${{ matrix.arch }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest]
|
||||
arch: [x86_64, arm64]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ matrix.os }}-${{ matrix.arch }}
|
||||
|
||||
- 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 -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -D BUILD_SHARED_LIBS=ON -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -DCMAKE_INSTALL_PREFIX=./install ..
|
||||
|
||||
- name: Build sherpa-onnx for macOS ${{ matrix.arch }}
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
|
||||
cd build
|
||||
make -j2
|
||||
make install
|
||||
|
||||
ls -lh lib
|
||||
ls -lh bin
|
||||
|
||||
file install/lib/lib*
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.os }}-for-${{ matrix.arch }}
|
||||
path: ./build/install/lib/
|
||||
|
||||
windows:
|
||||
name: Windows ${{ matrix.arch }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest]
|
||||
arch: [x64, Win32]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure CMake
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -A ${{ matrix.arch }} -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=./install ..
|
||||
|
||||
- name: Build sherpa-onnx for windows
|
||||
shell: bash
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --config Release -- -m:2
|
||||
cmake --build . --config Release --target install -- -m:2
|
||||
|
||||
ls -lh install/*
|
||||
|
||||
ls -lh install/lib
|
||||
ls -lh install/bin
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: sherpa-onnx-go-windows-${{ matrix.arch }}
|
||||
path: ./build/install/lib/
|
||||
|
||||
Release:
|
||||
name: Release
|
||||
release_go:
|
||||
name: Release go
|
||||
runs-on: ubuntu-latest
|
||||
needs: [linux-x86_64_wheel, macOS, windows]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -163,46 +26,8 @@ jobs:
|
||||
echo "${{ secrets.MY_GITHUB_SSH_KEY }}" > ~/.ssh/github && chmod 600 ~/.ssh/github
|
||||
ssh github.com || true
|
||||
|
||||
- name: Retrieve artifact from ubuntu-latest
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: ubuntu-latest-wheels-for-go
|
||||
path: ./linux
|
||||
|
||||
- name: Retrieve artifact from macos-latest (x86_64)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: macos-latest-for-x86_64
|
||||
path: ./macos-x86_64
|
||||
|
||||
- name: Retrieve artifact from macos-latest (arm64)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: macos-latest-for-arm64
|
||||
path: ./macos-arm64
|
||||
|
||||
- name: Retrieve artifact from windows-latest (x64)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: sherpa-onnx-go-windows-x64
|
||||
path: ./windows-x64
|
||||
|
||||
- name: Retrieve artifact from windows-latest (Win32)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: sherpa-onnx-go-windows-Win32
|
||||
path: ./windows-win32
|
||||
|
||||
- name: Unzip Ubuntu wheels
|
||||
- name: Release
|
||||
shell: bash
|
||||
run: |
|
||||
cd linux
|
||||
ls -lh
|
||||
unzip ./*.whl
|
||||
tree .
|
||||
|
||||
- name: Release go
|
||||
# if: env.VERSION != ''
|
||||
shell: bash
|
||||
run: |
|
||||
./scripts/go/release.sh
|
||||
cd scripts/go
|
||||
./release.sh
|
||||
|
||||
16
.github/workflows/test-go-package.yaml
vendored
16
.github/workflows/test-go-package.yaml
vendored
@@ -95,6 +95,11 @@ jobs:
|
||||
./run-vits-zh-aishell3.sh
|
||||
rm -rf vits-zh-aishell3
|
||||
|
||||
echo "Test vits-piper-en_US-lessac-medium"
|
||||
git clone https://huggingface.co/csukuangfj/vits-piper-en_US-lessac-medium
|
||||
./run-vits-piper-en_US-lessac-medium.sh
|
||||
rm -rf vits-piper-en_US-lessac-medium
|
||||
|
||||
ls -lh *.wav
|
||||
cp *.wav ../../tts-waves/
|
||||
|
||||
@@ -133,6 +138,11 @@ jobs:
|
||||
./run-vits-zh-aishell3.sh
|
||||
rm -rf vits-zh-aishell3
|
||||
|
||||
echo "Test vits-piper-en_US-lessac-medium"
|
||||
git clone https://huggingface.co/csukuangfj/vits-piper-en_US-lessac-medium
|
||||
./run-vits-piper-en_US-lessac-medium.sh
|
||||
rm -rf vits-piper-en_US-lessac-medium
|
||||
|
||||
ls -lh *.wav
|
||||
cp *.wav ../../tts-waves/
|
||||
|
||||
@@ -140,6 +150,7 @@ jobs:
|
||||
if: matrix.os == 'windows-latest' && matrix.arch == 'x86'
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir tts-waves
|
||||
cd go-api-examples/non-streaming-tts
|
||||
ls -lh
|
||||
go mod tidy
|
||||
@@ -178,6 +189,11 @@ jobs:
|
||||
./run-vits-zh-aishell3.sh
|
||||
rm -rf vits-zh-aishell3
|
||||
|
||||
echo "Test vits-piper-en_US-lessac-medium"
|
||||
git clone https://huggingface.co/csukuangfj/vits-piper-en_US-lessac-medium
|
||||
./run-vits-piper-en_US-lessac-medium.sh
|
||||
rm -rf vits-piper-en_US-lessac-medium
|
||||
|
||||
ls -lh *.wav
|
||||
cp *.wav ../../tts-waves/
|
||||
|
||||
|
||||
10
.github/workflows/test-go.yaml
vendored
10
.github/workflows/test-go.yaml
vendored
@@ -65,6 +65,8 @@ jobs:
|
||||
run: |
|
||||
mkdir tts-waves
|
||||
|
||||
cp -v go-api-examples/non-streaming-tts/*.sh scripts/go/_internal/non-streaming-tts/
|
||||
|
||||
cd scripts/go/_internal/non-streaming-tts/
|
||||
ls -lh
|
||||
go mod tidy
|
||||
@@ -89,6 +91,11 @@ jobs:
|
||||
./run-vits-zh-aishell3.sh
|
||||
rm -rf vits-zh-aishell3
|
||||
|
||||
echo "Test vits-piper-en_US-lessac-medium"
|
||||
git clone https://huggingface.co/csukuangfj/vits-piper-en_US-lessac-medium
|
||||
./run-vits-piper-en_US-lessac-medium.sh
|
||||
rm -rf vits-piper-en_US-lessac-medium
|
||||
|
||||
cp *.wav ../../../../tts-waves/
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
@@ -99,6 +106,8 @@ jobs:
|
||||
- name: Test non-streaming decoding files (macOS)
|
||||
shell: bash
|
||||
run: |
|
||||
cp -v go-api-examples/non-streaming-decode-files/*.sh scripts/go/_internal/non-streaming-decode-files/
|
||||
|
||||
cd scripts/go/_internal/non-streaming-decode-files/
|
||||
ls -lh
|
||||
go mod tidy
|
||||
@@ -139,6 +148,7 @@ jobs:
|
||||
- name: Test streaming decoding files
|
||||
shell: bash
|
||||
run: |
|
||||
cp -v go-api-examples/streaming-decode-files/*.sh scripts/go/_internal/streaming-decode-files
|
||||
cd scripts/go/_internal/streaming-decode-files
|
||||
ls -lh
|
||||
go mod tidy
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
||||
project(sherpa-onnx)
|
||||
|
||||
set(SHERPA_ONNX_VERSION "1.9.1")
|
||||
set(SHERPA_ONNX_VERSION "1.9.3")
|
||||
|
||||
# Disable warning about
|
||||
#
|
||||
|
||||
@@ -13,4 +13,4 @@ Cflags: -I"${includedir}"
|
||||
# Note: -lcargs is required only for the following file
|
||||
# https://github.com/k2-fsa/sherpa-onnx/blob/master/c-api-examples/decode-file-c-api.c
|
||||
# We add it here so that users don't need to specify -lcargs when compiling decode-file-c-api.c
|
||||
Libs: -L"${libdir}" -lsherpa-onnx-c-api -lsherpa-onnx-core -lonnxruntime -lkaldi-decoder-core -lsherpa-onnx-kaldifst-core -lsherpa-onnx-fst -lkaldi-native-fbank-core -lpiper_phonemize -lespeak-ng -lucd -lcargs -Wl,-rpath,${libdir} @SHERPA_ONNX_PKG_CONFIG_EXTRA_LIBS@
|
||||
Libs: -L"${libdir}" -lsherpa-onnx-c-api -lsherpa-onnx-core -lkaldi-decoder-core -lsherpa-onnx-kaldifst-core -lsherpa-onnx-fst -lkaldi-native-fbank-core -lpiper_phonemize -lespeak-ng -lucd -lcargs -lonnxruntime -Wl,-rpath,${libdir} @SHERPA_ONNX_PKG_CONFIG_EXTRA_LIBS@
|
||||
|
||||
@@ -16,6 +16,7 @@ func main() {
|
||||
flag.StringVar(&config.Model.Vits.Model, "vits-model", "", "Path to the vits ONNX model")
|
||||
flag.StringVar(&config.Model.Vits.Lexicon, "vits-lexicon", "", "Path to lexicon.txt")
|
||||
flag.StringVar(&config.Model.Vits.Tokens, "vits-tokens", "", "Path to tokens.txt")
|
||||
flag.StringVar(&config.Model.Vits.DataDir, "vits-data-dir", "", "Path to espeak-ng-data")
|
||||
|
||||
flag.Float32Var(&config.Model.Vits.NoiseScale, "vits-noise-scale", 0.667, "noise_scale for VITS")
|
||||
flag.Float32Var(&config.Model.Vits.NoiseScaleW, "vits-noise-scale-w", 0.8, "noise_scale_w for VITS")
|
||||
@@ -24,6 +25,8 @@ func main() {
|
||||
flag.IntVar(&config.Model.NumThreads, "num-threads", 1, "Number of threads for computing")
|
||||
flag.IntVar(&config.Model.Debug, "debug", 0, "Whether to show debug message")
|
||||
flag.StringVar(&config.Model.Provider, "provider", "cpu", "Provider to use")
|
||||
flag.StringVar(&config.RuleFsts, "tts-rule-fsts", "", "Path to rule.fst")
|
||||
flag.IntVar(&config.MaxNumSentences, "tts-max-num-sentences", 1, "Batch size")
|
||||
|
||||
flag.IntVar(&sid, "sid", 0, "Speaker ID. Used only for multi-speaker models")
|
||||
flag.StringVar(&filename, "output-filename", "./generated.wav", "Filename to save the generated audio")
|
||||
|
||||
12
go-api-examples/non-streaming-tts/run-vits-piper-en_US-lessac-medium.sh
Executable file
12
go-api-examples/non-streaming-tts/run-vits-piper-en_US-lessac-medium.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# please refer to
|
||||
# https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/vits.html#en-us-lessac-medium-english-single-speaker
|
||||
# to download the model before you run this script
|
||||
|
||||
./non-streaming-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-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!'
|
||||
@@ -9,8 +9,18 @@ for sid in 10 33 99; do
|
||||
--vits-model=./vits-zh-aishell3/vits-aishell3.onnx \
|
||||
--vits-lexicon=./vits-zh-aishell3/lexicon.txt \
|
||||
--vits-tokens=./vits-zh-aishell3/tokens.txt \
|
||||
--sid=10 \
|
||||
--sid=$sid \
|
||||
--debug=1 \
|
||||
--output-filename=./liliana-$sid.wav \
|
||||
"林美丽最美丽、最漂亮、最可爱!"
|
||||
|
||||
./non-streaming-tts \
|
||||
--vits-model=./vits-zh-aishell3/vits-aishell3.onnx \
|
||||
--vits-lexicon=./vits-zh-aishell3/lexicon.txt \
|
||||
--vits-tokens=./vits-zh-aishell3/tokens.txt \
|
||||
--tts-rule-fsts=./vits-zh-aishell3/rule.fst \
|
||||
--sid=$sid \
|
||||
--debug=1 \
|
||||
--output-filename=./numbers-$sid.wav \
|
||||
"数字12345.6789怎么念"
|
||||
done
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
package sherpa_onnx
|
||||
|
||||
// #cgo LDFLAGS: -L ${SRCDIR}/lib/x86_64-apple-darwin -lsherpa-onnx-c-api -lsherpa-onnx-core -lkaldi-native-fbank-core -lonnxruntime -Wl,-rpath,${SRCDIR}/lib/x86_64-apple-darwin
|
||||
// #cgo LDFLAGS: -L ${SRCDIR}/lib/x86_64-apple-darwin -lsherpa-onnx-c-api -lsherpa-onnx-core -lkaldi-native-fbank-core -lkaldi-decoder-core -lsherpa-onnx-kaldifst-core -lsherpa-onnx-fst -lpiper_phonemize -lespeak-ng -lucd -lonnxruntime -Wl,-rpath,${SRCDIR}/lib/x86_64-apple-darwin
|
||||
import "C"
|
||||
|
||||
@@ -5,145 +5,159 @@ set -ex
|
||||
git config --global user.email "csukuangfj@gmail.com"
|
||||
git config --global user.name "Fangjun Kuang"
|
||||
|
||||
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
SHERPA_ONNX_DIR=$(realpath $SCRIPT_DIR/../..)
|
||||
echo "SCRIPT_DIR: $SCRIPT_DIR"
|
||||
echo "SHERPA_ONNX_DIR: $SHERPA_ONNX_DIR"
|
||||
|
||||
echo "========================================================================="
|
||||
|
||||
git clone git@github.com:k2-fsa/sherpa-onnx-go-linux.git
|
||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" $SHERPA_ONNX_DIR/CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
||||
|
||||
echo "Copy libs for Linux x86_64"
|
||||
function linux() {
|
||||
echo "Process linux"
|
||||
git clone git@github.com:k2-fsa/sherpa-onnx-go-linux.git
|
||||
cp -v ./sherpa_onnx.go ./sherpa-onnx-go-linux/
|
||||
cp -v ./_internal/c-api.h ./sherpa-onnx-go-linux/
|
||||
|
||||
rm -rf sherpa-onnx-go-linux/lib/x86_64-unknown-linux-gnu/lib*
|
||||
rm -rf sherpa-onnx-go-linux/lib/x86_64-unknown-linux-gnu/lib*
|
||||
dst=$(realpath sherpa-onnx-go-linux/lib/x86_64-unknown-linux-gnu)
|
||||
mkdir t
|
||||
cd t
|
||||
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
|
||||
unzip ./sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
|
||||
|
||||
cp -v ./linux/sherpa_onnx/lib/libkaldi-native-fbank-core.so sherpa-onnx-go-linux/lib/x86_64-unknown-linux-gnu/
|
||||
cp -v ./linux/sherpa_onnx/lib/libonnxruntime* sherpa-onnx-go-linux/lib/x86_64-unknown-linux-gnu/
|
||||
cp -v ./linux/sherpa_onnx/lib/libsherpa-onnx-c-api.so sherpa-onnx-go-linux/lib/x86_64-unknown-linux-gnu/
|
||||
cp -v ./linux/sherpa_onnx/lib/libsherpa-onnx-core.so sherpa-onnx-go-linux/lib/x86_64-unknown-linux-gnu/
|
||||
cp -v sherpa_onnx/lib/*.so* $dst
|
||||
|
||||
echo "Copy sources for Linux x86_64"
|
||||
cp sherpa-onnx/c-api/c-api.h sherpa-onnx-go-linux/
|
||||
cp scripts/go/sherpa_onnx.go sherpa-onnx-go-linux/
|
||||
cd ..
|
||||
rm -rf t
|
||||
|
||||
pushd sherpa-onnx-go-linux
|
||||
tag=$(git describe --abbrev=0 --tags)
|
||||
if [[ x"$VERSION" == x"auto" ]]; then
|
||||
# this is a pre-release
|
||||
if [[ $tag == ${SHERPA_ONNX_VERSION}* ]]; then
|
||||
# echo we have already release pre-release before, so just increment it
|
||||
last=$(echo $tag | rev | cut -d'.' -f 1 | rev)
|
||||
new_last=$((last+1))
|
||||
new_tag=${SHERPA_ONNX_VERSION}-alpha.${new_last}
|
||||
else
|
||||
new_tag=${SHERPA_ONNX_VERSION}-alpha.1
|
||||
fi
|
||||
else
|
||||
new_tag=$VERSION
|
||||
fi
|
||||
rm -rf sherpa-onnx-go-linux/lib/aarch64-unknown-linux-gnu/lib*
|
||||
dst=$(realpath sherpa-onnx-go-linux/lib/aarch64-unknown-linux-gnu)
|
||||
mkdir t
|
||||
cd t
|
||||
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
|
||||
unzip ./sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
|
||||
|
||||
echo "new_tag: $new_tag"
|
||||
git add .
|
||||
git status
|
||||
git commit -m "Release $new_tag" && \
|
||||
git push && \
|
||||
git tag $new_tag && \
|
||||
git push origin $new_tag || true
|
||||
cp -v sherpa_onnx/lib/*.so* $dst
|
||||
|
||||
popd
|
||||
echo "========================================================================="
|
||||
cd ..
|
||||
rm -rf t
|
||||
|
||||
git clone git@github.com:k2-fsa/sherpa-onnx-go-macos.git
|
||||
rm -rf sherpa-onnx-go-linux/lib/arm-unknown-linux-gnueabihf/lib*
|
||||
dst=$(realpath sherpa-onnx-go-linux/lib/arm-unknown-linux-gnueabihf)
|
||||
mkdir t
|
||||
cd t
|
||||
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-linux_armv7l.whl
|
||||
unzip ./sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-linux_armv7l.whl
|
||||
|
||||
echo "Copy libs for macOS x86_64"
|
||||
rm -rf sherpa-onnx-go-macos/lib/x86_64-apple-darwin/lib*
|
||||
cp -v ./macos-x86_64/libkaldi-native-fbank-core.dylib sherpa-onnx-go-macos/lib/x86_64-apple-darwin
|
||||
cp -v ./macos-x86_64/libonnxruntime* sherpa-onnx-go-macos/lib/x86_64-apple-darwin
|
||||
cp -v ./macos-x86_64/libsherpa-onnx-c-api.dylib sherpa-onnx-go-macos/lib/x86_64-apple-darwin
|
||||
cp -v ./macos-x86_64/libsherpa-onnx-core.dylib sherpa-onnx-go-macos/lib/x86_64-apple-darwin
|
||||
cp -v sherpa_onnx/lib/*.so* $dst
|
||||
|
||||
echo "Copy libs for macOS arm64"
|
||||
rm -rf sherpa-onnx-go-macos/lib/aarch64-apple-darwin/lib*
|
||||
cp -v ./macos-arm64/libkaldi-native-fbank-core.dylib sherpa-onnx-go-macos/lib/aarch64-apple-darwin
|
||||
cp -v ./macos-arm64/libonnxruntime* sherpa-onnx-go-macos/lib/aarch64-apple-darwin
|
||||
cp -v ./macos-arm64/libsherpa-onnx-c-api.dylib sherpa-onnx-go-macos/lib/aarch64-apple-darwin
|
||||
cp -v ./macos-arm64/libsherpa-onnx-core.dylib sherpa-onnx-go-macos/lib/aarch64-apple-darwin
|
||||
cd ..
|
||||
rm -rf t
|
||||
|
||||
echo "Copy sources for macOS"
|
||||
cp sherpa-onnx/c-api/c-api.h sherpa-onnx-go-macos/
|
||||
cp scripts/go/sherpa_onnx.go sherpa-onnx-go-macos/
|
||||
echo "------------------------------"
|
||||
cd sherpa-onnx-go-linux
|
||||
git status
|
||||
git add .
|
||||
git commit -m "Release v$SHERPA_ONNX_VERSION" && \
|
||||
git push && \
|
||||
git tag v$SHERPA_ONNX_VERSION && \
|
||||
git push origin v$SHERPA_ONNX_VERSION || true
|
||||
cd ..
|
||||
rm -rf sherpa-onnx-go-linux
|
||||
}
|
||||
|
||||
pushd sherpa-onnx-go-macos
|
||||
tag=$(git describe --abbrev=0 --tags)
|
||||
if [[ x"$VERSION" == x"auto" ]]; then
|
||||
# this is a pre-release
|
||||
if [[ $tag == ${SHERPA_ONNX_VERSION}* ]]; then
|
||||
# echo we have already release pre-release before, so just increment it
|
||||
last=$(echo $tag | rev | cut -d'.' -f 1 | rev)
|
||||
new_last=$((last+1))
|
||||
new_tag=${SHERPA_ONNX_VERSION}-alpha.${new_last}
|
||||
else
|
||||
new_tag=${SHERPA_ONNX_VERSION}-alpha.1
|
||||
fi
|
||||
else
|
||||
new_tag=$VERSION
|
||||
fi
|
||||
function osx() {
|
||||
echo "Process osx-x64"
|
||||
git clone git@github.com:k2-fsa/sherpa-onnx-go-macos.git
|
||||
cp -v ./sherpa_onnx.go ./sherpa-onnx-go-macos/
|
||||
cp -v ./_internal/c-api.h ./sherpa-onnx-go-macos/
|
||||
|
||||
echo "new_tag: $new_tag"
|
||||
git add .
|
||||
git status
|
||||
git commit -m "Release $new_tag" && \
|
||||
git push && \
|
||||
git tag $new_tag && \
|
||||
git push origin $new_tag || true
|
||||
rm -rf sherpa-onnx-go-macos/lib/x86_64-apple-darwin/lib*
|
||||
dst=$(realpath sherpa-onnx-go-macos/lib/x86_64-apple-darwin/)
|
||||
|
||||
popd
|
||||
echo "========================================================================="
|
||||
mkdir t
|
||||
cd t
|
||||
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-macosx_10_14_x86_64.whl
|
||||
unzip ./sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-macosx_10_14_x86_64.whl
|
||||
|
||||
git clone git@github.com:k2-fsa/sherpa-onnx-go-windows.git
|
||||
echo "Copy libs for Windows x86_64"
|
||||
rm -fv sherpa-onnx-go-windows/lib/x86_64-pc-windows-gnu/*
|
||||
cp -v ./windows-x64/kaldi-native-fbank-core.dll sherpa-onnx-go-windows/lib/x86_64-pc-windows-gnu
|
||||
cp -v ./windows-x64/onnxruntime.dll sherpa-onnx-go-windows/lib/x86_64-pc-windows-gnu
|
||||
cp -v ./windows-x64/sherpa-onnx-c-api.dll sherpa-onnx-go-windows/lib/x86_64-pc-windows-gnu
|
||||
cp -v ./windows-x64/sherpa-onnx-core.dll sherpa-onnx-go-windows/lib/x86_64-pc-windows-gnu
|
||||
cp -v sherpa_onnx/lib/*.dylib $dst/
|
||||
|
||||
echo "Copy libs for Windows x86"
|
||||
rm -fv sherpa-onnx-go-windows/lib/i686-pc-windows-gnu/*
|
||||
cp -v ./windows-win32/kaldi-native-fbank-core.dll sherpa-onnx-go-windows/lib/i686-pc-windows-gnu
|
||||
cp -v ./windows-win32/onnxruntime.dll sherpa-onnx-go-windows/lib/i686-pc-windows-gnu
|
||||
cp -v ./windows-win32/sherpa-onnx-c-api.dll sherpa-onnx-go-windows/lib/i686-pc-windows-gnu
|
||||
cp -v ./windows-win32/sherpa-onnx-core.dll sherpa-onnx-go-windows/lib/i686-pc-windows-gnu
|
||||
cd ..
|
||||
rm -rf t
|
||||
|
||||
echo "Copy sources for Windows"
|
||||
cp sherpa-onnx/c-api/c-api.h sherpa-onnx-go-windows/
|
||||
cp scripts/go/sherpa_onnx.go sherpa-onnx-go-windows/
|
||||
echo "process macos arm64"
|
||||
rm -rf sherpa-onnx-go-macos/lib/aarch64-apple-darwin/lib*
|
||||
dst=$(realpath sherpa-onnx-go-macos/lib/aarch64-apple-darwin)
|
||||
|
||||
pushd sherpa-onnx-go-windows
|
||||
tag=$(git describe --abbrev=0 --tags)
|
||||
if [[ x"$VERSION" == x"auto" ]]; then
|
||||
# this is a pre-release
|
||||
if [[ $tag == ${SHERPA_ONNX_VERSION}* ]]; then
|
||||
# echo we have already release pre-release before, so just increment it
|
||||
last=$(echo $tag | rev | cut -d'.' -f 1 | rev)
|
||||
new_last=$((last+1))
|
||||
new_tag=${SHERPA_ONNX_VERSION}-alpha.${new_last}
|
||||
else
|
||||
new_tag=${SHERPA_ONNX_VERSION}-alpha.1
|
||||
fi
|
||||
else
|
||||
new_tag=$VERSION
|
||||
fi
|
||||
mkdir t
|
||||
cd t
|
||||
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-macosx_11_0_arm64.whl
|
||||
unzip ./sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-macosx_11_0_arm64.whl
|
||||
|
||||
echo "new_tag: $new_tag"
|
||||
git add .
|
||||
git status
|
||||
git commit -m "Release $new_tag" && \
|
||||
git push && \
|
||||
git tag $new_tag && \
|
||||
git push origin $new_tag || true
|
||||
cp -v sherpa_onnx/lib/*.dylib $dst/
|
||||
|
||||
popd
|
||||
cd ..
|
||||
rm -rf t
|
||||
echo "------------------------------"
|
||||
cd sherpa-onnx-go-macos
|
||||
git status
|
||||
git add .
|
||||
git commit -m "Release v$SHERPA_ONNX_VERSION" && \
|
||||
git push && \
|
||||
git tag v$SHERPA_ONNX_VERSION && \
|
||||
git push origin v$SHERPA_ONNX_VERSION || true
|
||||
cd ..
|
||||
rm -rf sherpa-onnx-go-macos
|
||||
}
|
||||
|
||||
echo "========================================================================="
|
||||
function windows() {
|
||||
echo "Process windows"
|
||||
git clone git@github.com:k2-fsa/sherpa-onnx-go-windows.git
|
||||
cp -v ./sherpa_onnx.go ./sherpa-onnx-go-windows/
|
||||
cp -v ./_internal/c-api.h ./sherpa-onnx-go-windows/
|
||||
|
||||
rm -fv sherpa-onnx-go-windows/lib/x86_64-pc-windows-gnu/*
|
||||
dst=$(realpath sherpa-onnx-go-windows/lib/x86_64-pc-windows-gnu)
|
||||
mkdir t
|
||||
cd t
|
||||
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-win_amd64.whl
|
||||
unzip ./sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-win_amd64.whl
|
||||
|
||||
cp -v sherpa_onnx-${SHERPA_ONNX_VERSION}.data/data/bin/*.dll $dst
|
||||
cp -v sherpa_onnx-${SHERPA_ONNX_VERSION}.data/data/bin/*.lib $dst
|
||||
|
||||
cd ..
|
||||
rm -rf t
|
||||
|
||||
rm -fv sherpa-onnx-go-windows/lib/i686-pc-windows-gnu/*
|
||||
dst=$(realpath sherpa-onnx-go-windows/lib/i686-pc-windows-gnu)
|
||||
mkdir t
|
||||
cd t
|
||||
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-win32.whl
|
||||
unzip ./sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-win32.whl
|
||||
|
||||
cp -v sherpa_onnx-${SHERPA_ONNX_VERSION}.data/data/bin/*.dll $dst
|
||||
cp -v sherpa_onnx-${SHERPA_ONNX_VERSION}.data/data/bin/*.lib $dst
|
||||
|
||||
cd ..
|
||||
rm -rf t
|
||||
echo "------------------------------"
|
||||
cd sherpa-onnx-go-windows
|
||||
git status
|
||||
git add .
|
||||
git commit -m "Release v$SHERPA_ONNX_VERSION" && \
|
||||
git push && \
|
||||
git tag v$SHERPA_ONNX_VERSION && \
|
||||
git push origin v$SHERPA_ONNX_VERSION || true
|
||||
cd ..
|
||||
rm -rf sherpa-onnx-go-windows
|
||||
}
|
||||
|
||||
|
||||
windows
|
||||
linux
|
||||
osx
|
||||
|
||||
rm -fv ~/.ssh/github
|
||||
|
||||
@@ -503,6 +503,7 @@ type OfflineTtsVitsModelConfig struct {
|
||||
Model string // Path to the VITS onnx model
|
||||
Lexicon string // Path to lexicon.txt
|
||||
Tokens string // Path to tokens.txt
|
||||
DataDir string // Path to tokens.txt
|
||||
NoiseScale float32 // noise scale for vits models. Please use 0.667 in general
|
||||
NoiseScaleW float32 // noise scale for vits models. Please use 0.8 in general
|
||||
LengthScale float32 // Please use 1.0 in general. Smaller -> Faster speech speed. Larger -> Slower speech speed
|
||||
@@ -522,7 +523,9 @@ type OfflineTtsModelConfig struct {
|
||||
}
|
||||
|
||||
type OfflineTtsConfig struct {
|
||||
Model OfflineTtsModelConfig
|
||||
Model OfflineTtsModelConfig
|
||||
RuleFsts string
|
||||
MaxNumSentences int
|
||||
}
|
||||
|
||||
type GeneratedAudio struct {
|
||||
@@ -547,6 +550,12 @@ func DeleteOfflineTts(tts *OfflineTts) {
|
||||
// the returned tts to avoid memory leak
|
||||
func NewOfflineTts(config *OfflineTtsConfig) *OfflineTts {
|
||||
c := C.struct_SherpaOnnxOfflineTtsConfig{}
|
||||
|
||||
c.rule_fsts = C.CString(config.RuleFsts)
|
||||
defer C.free(unsafe.Pointer(c.rule_fsts))
|
||||
|
||||
c.max_num_sentences = C.int(config.MaxNumSentences)
|
||||
|
||||
c.model.vits.model = C.CString(config.Model.Vits.Model)
|
||||
defer C.free(unsafe.Pointer(c.model.vits.model))
|
||||
|
||||
@@ -556,6 +565,9 @@ func NewOfflineTts(config *OfflineTtsConfig) *OfflineTts {
|
||||
c.model.vits.tokens = C.CString(config.Model.Vits.Tokens)
|
||||
defer C.free(unsafe.Pointer(c.model.vits.tokens))
|
||||
|
||||
c.model.vits.data_dir = C.CString(config.Model.Vits.DataDir)
|
||||
defer C.free(unsafe.Pointer(c.model.vits.data_dir))
|
||||
|
||||
c.model.vits.noise_scale = C.float(config.Model.Vits.NoiseScale)
|
||||
c.model.vits.noise_scale_w = C.float(config.Model.Vits.NoiseScaleW)
|
||||
c.model.vits.length_scale = C.float(config.Model.Vits.LengthScale)
|
||||
|
||||
Reference in New Issue
Block a user