Fangjun Kuang
Committed by GitHub

Support onnxruntime 1.16.0 (#330)

... ... @@ -55,3 +55,4 @@ jobs:
with:
file_glob: true
file: apks/*.apk
overwrite: true
... ...
... ... @@ -76,7 +76,7 @@ jobs:
uses: actions/cache@v3
with:
path: toolchain
key: gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf
key: gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf
- name: Download toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
... ... @@ -87,19 +87,19 @@ jobs:
ls -lh arm-linux-gcc
mkdir $GITHUB_WORKSPACE/toolchain
tar xvf ./arm-linux-gcc/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz --strip-components 1 -C $GITHUB_WORKSPACE/toolchain
tar xvf ./arm-linux-gcc/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz --strip-components 1 -C $GITHUB_WORKSPACE/toolchain
- name: Display toolchain info
shell: bash
run: |
export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH
arm-linux-gnueabihf-gcc --version
arm-none-linux-gnueabihf-gcc --version
- name: Display qemu-arm -h
shell: bash
run: |
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/arm-linux-gnueabihf/libc
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/arm-none-linux-gnueabihf/libc
qemu-arm -h
- name: build arm-linux-gnueabihf
... ... @@ -119,7 +119,7 @@ jobs:
run: |
export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/arm-linux-gnueabihf/libc
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/arm-none-linux-gnueabihf/libc
ls -lh ./build-arm-linux-gnueabihf/bin
... ...
... ... @@ -24,7 +24,7 @@ jobs:
- name: Install dependencies
shell: bash
run: |
python3 -m pip install openai-whisper torch onnxruntime==1.15.1 onnx
python3 -m pip install openai-whisper torch onnxruntime onnx
- name: export ${{ matrix.model }}
shell: bash
... ...
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
project(sherpa-onnx)
set(SHERPA_ONNX_VERSION "1.7.16")
set(SHERPA_ONNX_VERSION "1.7.17")
# Disable warning about
#
... ...
... ... @@ -42,7 +42,7 @@ fi
echo "ANDROID_NDK: $ANDROID_NDK"
sleep 1
onnxruntime_version=v1.15.1
onnxruntime_version=v1.16.0
if [ ! -f ./android-onnxruntime-libs/$onnxruntime_version/jni/arm64-v8a/libonnxruntime.so ]; then
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/android-onnxruntime-libs
... ...
... ... @@ -43,7 +43,7 @@ fi
echo "ANDROID_NDK: $ANDROID_NDK"
sleep 1
onnxruntime_version=v1.15.1
onnxruntime_version=v1.16.0
if [ ! -f ./android-onnxruntime-libs/$onnxruntime_version/jni/armeabi-v7a/libonnxruntime.so ]; then
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/android-onnxruntime-libs
... ...
... ... @@ -43,7 +43,7 @@ fi
echo "ANDROID_NDK: $ANDROID_NDK"
sleep 1
onnxruntime_version=v1.15.1
onnxruntime_version=v1.16.0
if [ ! -f ./android-onnxruntime-libs/$onnxruntime_version/jni/x86_64/libonnxruntime.so ]; then
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/android-onnxruntime-libs
... ...
... ... @@ -43,7 +43,7 @@ fi
echo "ANDROID_NDK: $ANDROID_NDK"
sleep 1
onnxruntime_version=v1.15.1
onnxruntime_version=v1.16.0
if [ ! -f ./android-onnxruntime-libs/$onnxruntime_version/jni/x86/libonnxruntime.so ]; then
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/android-onnxruntime-libs
... ...
#!/usr/bin/env bash
if command -v arm-none-linux-gnueabihf-gcc &> /dev/null; then
ln -svf $(which arm-none-linux-gnueabihf-gcc) ./arm-linux-gnueabihf-gcc
ln -svf $(which arm-none-linux-gnueabihf-g++) ./arm-linux-gnueabihf-g++
export PATH=$PWD:$PATH
fi
if ! command -v arm-linux-gnueabihf-gcc &> /dev/null; then
echo "Please install a toolchain for cross-compiling."
echo "You can refer to: "
... ...
... ... @@ -5,12 +5,17 @@ set -e
dir=build-ios
mkdir -p $dir
cd $dir
onnxruntime_version=1.15.1
onnxruntime_version=1.16.0
if [ ! -f ios-onnxruntime/$onnxruntime_version/onnxruntime.xcframework/ios-arm64/onnxruntime.a ]; then
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/ios-onnxruntime
if [ ! -d ios-onnxruntime ]; then
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/ios-onnxruntime
fi
pushd ios-onnxruntime
ln -s $onnxruntime_version/onnxruntime.xcframework .
git pull
ln -sf $onnxruntime_version/onnxruntime.xcframework .
git lfs pull --include $onnxruntime_version/onnxruntime.xcframework/ios-arm64/onnxruntime.a
git lfs pull --include $onnxruntime_version/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.a
popd
... ...
... ... @@ -10,19 +10,19 @@ if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
message(FATAL_ERROR "This file is for aarch64 only. Given: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.15.1/onnxruntime-linux-aarch64-1.15.1.tgz")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-linux-aarch64-1.15.1.tgz")
set(onnxruntime_HASH "SHA256=85272e75d8dd841138de4b774a9672ea93c1be108d96038c6c34a62d7f976aee")
set(onnxruntime_URL "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-linux-aarch64-1.16.0.tgz")
set(onnxruntime_URL2 )
set(onnxruntime_HASH "SHA256=8b15781d974803203c09df7d52c84d8c9f1ac7d949a97f515e4d2f5dc978d8af")
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-linux-aarch64-1.15.1.tgz
${PROJECT_SOURCE_DIR}/onnxruntime-linux-aarch64-1.15.1.tgz
${PROJECT_BINARY_DIR}/onnxruntime-linux-aarch64-1.15.1.tgz
/tmp/onnxruntime-linux-aarch64-1.15.1.tgz
/star-fj/fangjun/download/github/onnxruntime-linux-aarch64-1.15.1.tgz
$ENV{HOME}/Downloads/onnxruntime-linux-aarch64-1.16.0.tgz
${PROJECT_SOURCE_DIR}/onnxruntime-linux-aarch64-1.16.0.tgz
${PROJECT_BINARY_DIR}/onnxruntime-linux-aarch64-1.16.0.tgz
/tmp/onnxruntime-linux-aarch64-1.16.0.tgz
/star-fj/fangjun/download/github/onnxruntime-linux-aarch64-1.16.0.tgz
)
foreach(f IN LISTS possible_file_locations)
... ...
... ... @@ -10,19 +10,19 @@ if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL arm)
message(FATAL_ERROR "This file is for arm only. Given: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
set(onnxruntime_URL "https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-linux-arm-1.15.1.zip")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-linux-arm-1.15.1.zip")
set(onnxruntime_HASH "SHA256=867b96210a347e4b1bb949e7c9a3f222371ea0c00c9deaaba9fdd66c689f7fb7")
set(onnxruntime_URL "https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-linux-arm-1.16.0.zip")
set(onnxruntime_URL2 )
set(onnxruntime_HASH "SHA256=0a63ea99fbba3ee399d6626c36752844ae93ae19bab30e4bf00d45cc8a13da02")
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-linux-arm-1.15.1.zip
${PROJECT_SOURCE_DIR}/onnxruntime-linux-arm-1.15.1.zip
${PROJECT_BINARY_DIR}/onnxruntime-linux-arm-1.15.1.zip
/tmp/onnxruntime-linux-arm-1.15.1.zip
/star-fj/fangjun/download/github/onnxruntime-linux-arm-1.15.1.zip
$ENV{HOME}/Downloads/onnxruntime-linux-arm-1.16.0.zip
${PROJECT_SOURCE_DIR}/onnxruntime-linux-arm-1.16.0.zip
${PROJECT_BINARY_DIR}/onnxruntime-linux-arm-1.16.0.zip
/tmp/onnxruntime-linux-arm-1.16.0.zip
/star-fj/fangjun/download/github/onnxruntime-linux-arm-1.16.0.zip
)
foreach(f IN LISTS possible_file_locations)
... ...
... ... @@ -18,19 +18,19 @@ if(NOT SHERPA_ONNX_ENABLE_GPU)
message(FATAL_ERROR "This file is for NVIDIA GPU only. Given SHERPA_ONNX_ENABLE_GPU: ${SHERPA_ONNX_ENABLE_GPU}")
endif()
set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.15.1/onnxruntime-linux-x64-gpu-1.15.1.tgz")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-linux-x64-gpu-1.15.1.tgz")
set(onnxruntime_HASH "SHA256=eab891393025edd5818d1aa26a42860e5739fcc49e3ca3f876110ec8736fe7f1")
set(onnxruntime_URL "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-linux-x64-gpu-1.16.0.tgz")
set(onnxruntime_URL2 )
set(onnxruntime_HASH "SHA256=f9cbf3d711f46d7e03ea43746ee9d1c7d8e82c171a4655f6591dd4d1ba1b9ec7")
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-linux-x64-gpu-1.15.1.tgz
${PROJECT_SOURCE_DIR}/onnxruntime-linux-x64-gpu-1.15.1.tgz
${PROJECT_BINARY_DIR}/onnxruntime-linux-x64-gpu-1.15.1.tgz
/tmp/onnxruntime-linux-x64-gpu-1.15.1.tgz
/star-fj/fangjun/download/github/onnxruntime-linux-x64-gpu-1.15.1.tgz
$ENV{HOME}/Downloads/onnxruntime-linux-x64-gpu-1.16.0.tgz
${PROJECT_SOURCE_DIR}/onnxruntime-linux-x64-gpu-1.16.0.tgz
${PROJECT_BINARY_DIR}/onnxruntime-linux-x64-gpu-1.16.0.tgz
/tmp/onnxruntime-linux-x64-gpu-1.16.0.tgz
/star-fj/fangjun/download/github/onnxruntime-linux-x64-gpu-1.16.0.tgz
)
foreach(f IN LISTS possible_file_locations)
... ...
... ... @@ -14,22 +14,19 @@ if(BUILD_SHARED_LIBS)
message(FATAL_ERROR "This file is for building static libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
endif()
# TODO(fangjun): update the URL
set(onnxruntime_URL "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-linux-x64-static_lib-1.15.1.tgz")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-linux-x64-static_lib-1.15.1.tgz")
set(onnxruntime_HASH "SHA256=b64fcf4115e3d02193c7406461d582703ccc1f0c24ad320ef74b07e5f71681c6")
set(onnxruntime_URL "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-linux-x64-static_lib-1.16.0.tgz")
set(onnxruntime_URL2 )
set(onnxruntime_HASH "SHA256=a36e989c9a07f12bf16f63acb2217b02a0cf4ac75aa7bc27de76ae08706a5c1f")
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
${PROJECT_SOURCE_DIR}/onnxruntime-linux-x64-static_lib-1.15.1.tgz
$ENV{HOME}/Downloads/onnxruntime-linux-x64-static_lib-1.15.1.tgz
${PROJECT_SOURCE_DIR}/onnxruntime-linux-x64-static_lib-1.15.1.tgz
${PROJECT_BINARY_DIR}/onnxruntime-linux-x64-static_lib-1.15.1.tgz
/tmp/onnxruntime-linux-x64-static_lib-1.15.1.tgz
/star-fj/fangjun/download/github/onnxruntime-linux-x64-static_lib-1.15.1.tgz
$ENV{HOME}/Downloads/onnxruntime-linux-x64-static_lib-1.16.0.tgz
${PROJECT_SOURCE_DIR}/onnxruntime-linux-x64-static_lib-1.16.0.tgz
${PROJECT_BINARY_DIR}/onnxruntime-linux-x64-static_lib-1.16.0.tgz
/tmp/onnxruntime-linux-x64-static_lib-1.16.0.tgz
/star-fj/fangjun/download/github/onnxruntime-linux-x64-static_lib-1.16.0.tgz
)
foreach(f IN LISTS possible_file_locations)
... ...
... ... @@ -14,19 +14,19 @@ if(NOT BUILD_SHARED_LIBS)
message(FATAL_ERROR "This file is for building shared libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
endif()
set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.15.1/onnxruntime-linux-x64-1.15.1.tgz")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-linux-x64-1.15.1.tgz")
set(onnxruntime_HASH "SHA256=5492f9065f87538a286fb04c8542e9ff7950abb2ea6f8c24993a940006787d87")
set(onnxruntime_URL "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-linux-x64-1.16.0.tgz")
set(onnxruntime_URL2 )
set(onnxruntime_HASH "SHA256=02bcd1e4fef295dacc3b232774efeaa0a83527f439f29147c3badade4df1f6dc")
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-linux-x64-1.15.1.tgz
${PROJECT_SOURCE_DIR}/onnxruntime-linux-x64-1.15.1.tgz
${PROJECT_BINARY_DIR}/onnxruntime-linux-x64-1.15.1.tgz
/tmp/onnxruntime-linux-x64-1.15.1.tgz
/star-fj/fangjun/download/github/onnxruntime-linux-x64-1.15.1.tgz
$ENV{HOME}/Downloads/onnxruntime-linux-x64-1.16.0.tgz
${PROJECT_SOURCE_DIR}/onnxruntime-linux-x64-1.16.0.tgz
${PROJECT_BINARY_DIR}/onnxruntime-linux-x64-1.16.0.tgz
/tmp/onnxruntime-linux-x64-1.16.0.tgz
/star-fj/fangjun/download/github/onnxruntime-linux-x64-1.16.0.tgz
)
foreach(f IN LISTS possible_file_locations)
... ...
... ... @@ -8,18 +8,18 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
message(FATAL_ERROR "This file is for macOS only. Given: ${CMAKE_SYSTEM_NAME}")
endif()
set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.15.1/onnxruntime-osx-arm64-1.15.1.tgz")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-osx-arm64-1.15.1.tgz")
set(onnxruntime_HASH "SHA256=df97832fc7907c6677a6da437f92339d84a462becb74b1d65217fcb859ee9460")
set(onnxruntime_URL "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-osx-arm64-1.16.0.tgz")
set(onnxruntime_URL2 )
set(onnxruntime_HASH "SHA256=fec3b70ca4f642a5c6d5c3a6f3a4eddd4c1b9281893fe2c7ae03a3086e20c316")
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-osx-arm64-1.15.1.tgz
${PROJECT_SOURCE_DIR}/onnxruntime-osx-arm64-1.15.1.tgz
${PROJECT_BINARY_DIR}/onnxruntime-osx-arm64-1.15.1.tgz
/tmp/onnxruntime-osx-arm64-1.15.1.tgz
$ENV{HOME}/Downloads/onnxruntime-osx-arm64-1.16.0.tgz
${PROJECT_SOURCE_DIR}/onnxruntime-osx-arm64-1.16.0.tgz
${PROJECT_BINARY_DIR}/onnxruntime-osx-arm64-1.16.0.tgz
/tmp/onnxruntime-osx-arm64-1.16.0.tgz
)
foreach(f IN LISTS possible_file_locations)
... ...
... ... @@ -9,18 +9,18 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
message(FATAL_ERROR "This file is for macOS only. Given: ${CMAKE_SYSTEM_NAME}")
endif()
set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.15.1/onnxruntime-osx-universal2-1.15.1.tgz")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-osx-universal2-1.15.1.tgz")
set(onnxruntime_HASH "SHA256=ecb7651c216fe6ffaf4c578e135d98341bc5bc944c5dc6b725ef85b0d7747be0")
set(onnxruntime_URL "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-osx-universal2-1.16.0.tgz")
set(onnxruntime_URL2 )
set(onnxruntime_HASH "SHA256=e5b69ece634cf1cd5cf4b45ab478417199a5e8ab5775f6f12560e09dc5ef7749")
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-osx-universal2-1.15.1.tgz
${PROJECT_SOURCE_DIR}/onnxruntime-osx-universal2-1.15.1.tgz
${PROJECT_BINARY_DIR}/onnxruntime-osx-universal2-1.15.1.tgz
/tmp/onnxruntime-osx-universal2-1.15.1.tgz
$ENV{HOME}/Downloads/onnxruntime-osx-universal2-1.16.0.tgz
${PROJECT_SOURCE_DIR}/onnxruntime-osx-universal2-1.16.0.tgz
${PROJECT_BINARY_DIR}/onnxruntime-osx-universal2-1.16.0.tgz
/tmp/onnxruntime-osx-universal2-1.16.0.tgz
)
foreach(f IN LISTS possible_file_locations)
... ...
... ... @@ -8,18 +8,18 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
message(FATAL_ERROR "This file is for macOS only. Given: ${CMAKE_SYSTEM_NAME}")
endif()
set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.15.1/onnxruntime-osx-x86_64-1.15.1.tgz")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-osx-x86_64-1.15.1.tgz")
set(onnxruntime_HASH "SHA256=4b66ebbca24b8b96f6b74655fee3610a7e529b4e01f6790632f24ee82b778e5a")
set(onnxruntime_URL "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-osx-x86_64-1.16.0.tgz")
set(onnxruntime_URL2 )
set(onnxruntime_HASH "SHA256=3d639a269af4e97a455f23cff363a709ef3a5f3e086162e65e3395c339122285")
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-osx-x86_64-1.15.1.tgz
${PROJECT_SOURCE_DIR}/onnxruntime-osx-x86_64-1.15.1.tgz
${PROJECT_BINARY_DIR}/onnxruntime-osx-x86_64-1.15.1.tgz
/tmp/onnxruntime-osx-x86_64-1.15.1.tgz
$ENV{HOME}/Downloads/onnxruntime-osx-x86_64-1.16.0.tgz
${PROJECT_SOURCE_DIR}/onnxruntime-osx-x86_64-1.16.0.tgz
${PROJECT_BINARY_DIR}/onnxruntime-osx-x86_64-1.16.0.tgz
/tmp/onnxruntime-osx-x86_64-1.16.0.tgz
)
foreach(f IN LISTS possible_file_locations)
... ...
... ... @@ -19,18 +19,18 @@ if(NOT SHERPA_ONNX_ENABLE_GPU)
message(FATAL_ERROR "This file is for NVIDIA GPU only. Given SHERPA_ONNX_ENABLE_GPU: ${SHERPA_ONNX_ENABLE_GPU}")
endif()
set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.15.1/onnxruntime-win-x64-gpu-1.15.1.zip")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-win-x64-gpu-1.15.1.zip")
set(onnxruntime_HASH "SHA256=dcc3a385b415dd2e4a813018b71da5085d9b97774552edf17947826a255a3732")
set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.16.0/onnxruntime-win-x64-gpu-1.16.0.zip")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-win-x64-gpu-1.16.0.zip")
set(onnxruntime_HASH "SHA256=2a824d2a98fe7328980fcd27016fe797137f7050b047eecf3a3f6b82a24f63c1")
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-win-x64-gpu-1.15.1.zip
${PROJECT_SOURCE_DIR}/onnxruntime-win-x64-gpu-1.15.1.zip
${PROJECT_BINARY_DIR}/onnxruntime-win-x64-gpu-1.15.1.zip
/tmp/onnxruntime-win-x64-gpu-1.15.1.zip
$ENV{HOME}/Downloads/onnxruntime-win-x64-gpu-1.16.0.zip
${PROJECT_SOURCE_DIR}/onnxruntime-win-x64-gpu-1.16.0.zip
${PROJECT_BINARY_DIR}/onnxruntime-win-x64-gpu-1.16.0.zip
/tmp/onnxruntime-win-x64-gpu-1.16.0.zip
)
foreach(f IN LISTS possible_file_locations)
... ...
... ... @@ -15,18 +15,18 @@ if(BUILD_SHARED_LIBS)
message(FATAL_ERROR "This file is for building static libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
endif()
set(onnxruntime_URL "https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-win-x64-static-1.15.1.tar.bz2")
set(onnxruntime_URL "https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-win-x64-static-1.16.0.tar.bz2")
set(onnxruntime_URL2 "")
set(onnxruntime_HASH "SHA256=c809a8510a89b8b37ae7d563c39229db22bac8fbefcbfe5c81a60b367d065b1b")
set(onnxruntime_HASH "SHA256=d1b87e8a438a7e31b46bf13a194c5ac38fdf60ebeefef82692008e42e3242776")
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-win-x64-static-1.15.1.tar.bz2
${PROJECT_SOURCE_DIR}/onnxruntime-win-x64-static-1.15.1.tar.bz2
${PROJECT_BINARY_DIR}/onnxruntime-win-x64-static-1.15.1.tar.bz2
/tmp/onnxruntime-win-x64-static-1.15.1.tar.bz2
$ENV{HOME}/Downloads/onnxruntime-win-x64-static-1.16.0.tar.bz2
${PROJECT_SOURCE_DIR}/onnxruntime-win-x64-static-1.16.0.tar.bz2
${PROJECT_BINARY_DIR}/onnxruntime-win-x64-static-1.16.0.tar.bz2
/tmp/onnxruntime-win-x64-static-1.16.0.tar.bz2
)
foreach(f IN LISTS possible_file_locations)
... ...
... ... @@ -15,18 +15,18 @@ if(NOT BUILD_SHARED_LIBS)
message(FATAL_ERROR "This file is for building shared libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
endif()
set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.15.1/onnxruntime-win-x64-1.15.1.zip")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-win-x64-1.15.1.zip")
set(onnxruntime_HASH "SHA256=261308ee5526dfd3f405ce8863e43d624a2e0bcd16b2d33cdea8c120ab3534d3")
set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.16.0/onnxruntime-win-x64-1.16.0.zip")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-win-x64-1.16.0.zip")
set(onnxruntime_HASH "SHA256=ce6777ecde7d4a6c9d4eab9774089fe04be1bad979323ae502e667b95222e08f")
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-win-x64-1.15.1.zip
${PROJECT_SOURCE_DIR}/onnxruntime-win-x64-1.15.1.zip
${PROJECT_BINARY_DIR}/onnxruntime-win-x64-1.15.1.zip
/tmp/onnxruntime-win-x64-1.15.1.zip
$ENV{HOME}/Downloads/onnxruntime-win-x64-1.16.0.zip
${PROJECT_SOURCE_DIR}/onnxruntime-win-x64-1.16.0.zip
${PROJECT_BINARY_DIR}/onnxruntime-win-x64-1.16.0.zip
/tmp/onnxruntime-win-x64-1.16.0.zip
)
foreach(f IN LISTS possible_file_locations)
... ...
... ... @@ -15,18 +15,18 @@ if(BUILD_SHARED_LIBS)
message(FATAL_ERROR "This file is for building static libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
endif()
set(onnxruntime_URL "https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-win-x86-static-1.15.1.tar.bz2")
set(onnxruntime_URL "https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-win-x86-static-1.16.0.tar.bz2")
set(onnxruntime_URL2 "")
set(onnxruntime_HASH "SHA256=94d9a30976b5c4a5dff7508d00f141835916e5a36315d5f53be9b3edb85148b5")
set(onnxruntime_HASH "SHA256=aedb6b5275f7832ac5117db8e40328a0842ae8ce6749a0c99bcb4218c53fdc60")
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-win-x86-static-1.15.1.tar.bz2
${PROJECT_SOURCE_DIR}/onnxruntime-win-x86-static-1.15.1.tar.bz2
${PROJECT_BINARY_DIR}/onnxruntime-win-x86-static-1.15.1.tar.bz2
/tmp/onnxruntime-win-x86-static-1.15.1.tar.bz2
$ENV{HOME}/Downloads/onnxruntime-win-x86-static-1.16.0.tar.bz2
${PROJECT_SOURCE_DIR}/onnxruntime-win-x86-static-1.16.0.tar.bz2
${PROJECT_BINARY_DIR}/onnxruntime-win-x86-static-1.16.0.tar.bz2
/tmp/onnxruntime-win-x86-static-1.16.0.tar.bz2
)
foreach(f IN LISTS possible_file_locations)
... ...
... ... @@ -15,18 +15,18 @@ if(NOT BUILD_SHARED_LIBS)
message(FATAL_ERROR "This file is for building shared libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
endif()
set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.15.1/onnxruntime-win-x86-1.15.1.zip")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-win-x86-1.15.1.zip")
set(onnxruntime_HASH "SHA256=8de18fdf274a8adcd95272fcf58beda0fe2fb37f0cd62c02bc4bb6200429e4e2")
set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.16.0/onnxruntime-win-x86-1.16.0.zip")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-win-x86-1.16.0.zip")
set(onnxruntime_HASH "SHA256=a1da9e0739336c826c04ab7cb63a3e7bf6ab0dda5fb8bbba17bba4cf8c7d4e20")
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-win-x86-1.15.1.zip
${PROJECT_SOURCE_DIR}/onnxruntime-win-x86-1.15.1.zip
${PROJECT_BINARY_DIR}/onnxruntime-win-x86-1.15.1.zip
/tmp/onnxruntime-win-x86-1.15.1.zip
$ENV{HOME}/Downloads/onnxruntime-win-x86-1.16.0.zip
${PROJECT_SOURCE_DIR}/onnxruntime-win-x86-1.16.0.zip
${PROJECT_BINARY_DIR}/onnxruntime-win-x86-1.16.0.zip
/tmp/onnxruntime-win-x86-1.16.0.zip
)
foreach(f IN LISTS possible_file_locations)
... ...
... ... @@ -40,7 +40,7 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
C93989AF2A89FE33009AB859 /* onnxruntime.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = onnxruntime.xcframework; path = "../../build-ios/ios-onnxruntime/1.15.1/onnxruntime.xcframework"; sourceTree = "<group>"; };
C93989AF2A89FE33009AB859 /* onnxruntime.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = onnxruntime.xcframework; path = "../../build-ios/ios-onnxruntime/1.16.0/onnxruntime.xcframework"; sourceTree = "<group>"; };
C93989B12A89FF78009AB859 /* decoder.int8.onnx */ = {isa = PBXFileReference; lastKnownFileType = file; name = decoder.int8.onnx; path = "../../../icefall-models/sherpa-onnx-streaming-paraformer-bilingual-zh-en/decoder.int8.onnx"; sourceTree = "<group>"; };
C93989B22A89FF78009AB859 /* encoder.int8.onnx */ = {isa = PBXFileReference; lastKnownFileType = file; name = encoder.int8.onnx; path = "../../../icefall-models/sherpa-onnx-streaming-paraformer-bilingual-zh-en/encoder.int8.onnx"; sourceTree = "<group>"; };
C93989B32A89FF78009AB859 /* tokens.txt */ = {isa = PBXFileReference; lastKnownFileType = text; name = tokens.txt; path = "../../../icefall-models/sherpa-onnx-streaming-paraformer-bilingual-zh-en/tokens.txt"; sourceTree = "<group>"; };
... ...
... ... @@ -30,7 +30,7 @@
C9A2588D2AAF039D00E555CA /* Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extension.swift; sourceTree = "<group>"; };
C9A258922AAF057E00E555CA /* SherpaOnnx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SherpaOnnx.swift; path = "../../../swift-api-examples/SherpaOnnx.swift"; sourceTree = "<group>"; };
C9A258952AAF05D100E555CA /* sherpa-onnx.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = "sherpa-onnx.xcframework"; path = "../../build-ios/sherpa-onnx.xcframework"; sourceTree = "<group>"; };
C9A258972AAF05E400E555CA /* onnxruntime.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = onnxruntime.xcframework; path = "../../build-ios/ios-onnxruntime/1.15.1/onnxruntime.xcframework"; sourceTree = "<group>"; };
C9A258972AAF05E400E555CA /* onnxruntime.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = onnxruntime.xcframework; path = "../../build-ios/ios-onnxruntime/1.16.0/onnxruntime.xcframework"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
... ...
... ... @@ -34,7 +34,7 @@ def get_dict():
def process_linux(s):
libs = [
"libkaldi-native-fbank-core.so",
"libonnxruntime.so.1.15.1",
"libonnxruntime.so.1.16.0",
"libsherpa-onnx-c-api.so",
"libsherpa-onnx-core.so",
]
... ... @@ -56,7 +56,7 @@ def process_linux(s):
def process_macos(s):
libs = [
"libkaldi-native-fbank-core.dylib",
"libonnxruntime.1.15.1.dylib",
"libonnxruntime.1.16.0.dylib",
"libsherpa-onnx-c-api.dylib",
"libsherpa-onnx-core.dylib",
]
... ...
... ... @@ -31,9 +31,18 @@ extern "C" {
#define SHERPA_ONNX_IMPORT
#endif
#else // WIN32
#define SHERPA_ONNX_EXPORT __attribute__((visibility("default")))
#if __APPLE__
// it throws a warning on macOS when using
// __attribute__((visibility("default")))
//
// warning: 'visibility' attribute ignored [-Wignored-attributes]
#define SHERPA_ONNX_EXPORT
#else
#define SHERPA_ONNX_EXPORT __attribute__((visibility("default")))
#endif // __APPLE__
#define SHERPA_ONNX_IMPORT SHERPA_ONNX_EXPORT
#endif
#endif // WIN32
#if defined(SHERPA_ONNX_BUILD_MAIN_LIB)
#define SHERPA_ONNX_API SHERPA_ONNX_EXPORT
... ... @@ -178,12 +187,14 @@ SHERPA_ONNX_API void DestroyOnlineRecognizer(
SHERPA_ONNX_API SherpaOnnxOnlineStream *CreateOnlineStream(
const SherpaOnnxOnlineRecognizer *recognizer);
/// Create an online stream for accepting wave samples with the specified hot words.
/// Create an online stream for accepting wave samples with the specified hot
/// words.
///
/// @param recognizer A pointer returned by CreateOnlineRecognizer()
/// @return Return a pointer to an OnlineStream. The user has to invoke
/// DestroyOnlineStream() to free it to avoid memory leak.
SHERPA_ONNX_API SherpaOnnxOnlineStream *CreateOnlineStreamWithHotwords(const SherpaOnnxOnlineRecognizer *recognizer, const char *hotwords);
SHERPA_ONNX_API SherpaOnnxOnlineStream *CreateOnlineStreamWithHotwords(
const SherpaOnnxOnlineRecognizer *recognizer, const char *hotwords);
/// Destroy an online stream.
///
... ...