Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Fangjun Kuang
2023-09-21 20:39:24 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2023-09-21 20:39:24 +0800
Commit
cf199ad4664569529912b4a082ca8bdc2224adf6
cf199ad4
1 parent
b640c295
Support onnxruntime 1.16.0 (#330)
隐藏空白字符变更
内嵌
并排对比
正在显示
27 个修改的文件
包含
139 行增加
和
119 行删除
.github/workflows/apk.yaml
.github/workflows/arm-linux-gnueabihf.yaml
.github/workflows/export-whisper-to-onnx.yaml
CMakeLists.txt
build-android-arm64-v8a.sh
build-android-armv7-eabi.sh
build-android-x86-64.sh
build-android-x86.sh
build-arm-linux-gnueabihf.sh
build-ios.sh
cmake/onnxruntime-linux-aarch64.cmake
cmake/onnxruntime-linux-arm.cmake
cmake/onnxruntime-linux-x86_64-gpu.cmake
cmake/onnxruntime-linux-x86_64-static.cmake
cmake/onnxruntime-linux-x86_64.cmake
cmake/onnxruntime-osx-arm64.cmake
cmake/onnxruntime-osx-universal.cmake
cmake/onnxruntime-osx-x86_64.cmake
cmake/onnxruntime-win-x64-gpu.cmake
cmake/onnxruntime-win-x64-static.cmake
cmake/onnxruntime-win-x64.cmake
cmake/onnxruntime-win-x86-static.cmake
cmake/onnxruntime-win-x86.cmake
ios-swift/SherpaOnnx/SherpaOnnx.xcodeproj/project.pbxproj
ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass.xcodeproj/project.pbxproj
scripts/dotnet/generate.py
sherpa-onnx/c-api/c-api.h
.github/workflows/apk.yaml
查看文件 @
cf199ad
...
...
@@ -55,3 +55,4 @@ jobs:
with
:
file_glob
:
true
file
:
apks/*.apk
overwrite
:
true
...
...
.github/workflows/arm-linux-gnueabihf.yaml
查看文件 @
cf199ad
...
...
@@ -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
...
...
.github/workflows/export-whisper-to-onnx.yaml
查看文件 @
cf199ad
...
...
@@ -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
...
...
CMakeLists.txt
查看文件 @
cf199ad
cmake_minimum_required
(
VERSION 3.13 FATAL_ERROR
)
project
(
sherpa-onnx
)
set
(
SHERPA_ONNX_VERSION
"1.7.1
6
"
)
set
(
SHERPA_ONNX_VERSION
"1.7.1
7
"
)
# Disable warning about
#
...
...
build-android-arm64-v8a.sh
查看文件 @
cf199ad
...
...
@@ -42,7 +42,7 @@ fi
echo
"ANDROID_NDK:
$ANDROID_NDK
"
sleep 1
onnxruntime_version
=
v1.1
5.1
onnxruntime_version
=
v1.1
6.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
...
...
build-android-armv7-eabi.sh
查看文件 @
cf199ad
...
...
@@ -43,7 +43,7 @@ fi
echo
"ANDROID_NDK:
$ANDROID_NDK
"
sleep 1
onnxruntime_version
=
v1.1
5.1
onnxruntime_version
=
v1.1
6.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
...
...
build-android-x86-64.sh
查看文件 @
cf199ad
...
...
@@ -43,7 +43,7 @@ fi
echo
"ANDROID_NDK:
$ANDROID_NDK
"
sleep 1
onnxruntime_version
=
v1.1
5.1
onnxruntime_version
=
v1.1
6.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
...
...
build-android-x86.sh
查看文件 @
cf199ad
...
...
@@ -43,7 +43,7 @@ fi
echo
"ANDROID_NDK:
$ANDROID_NDK
"
sleep 1
onnxruntime_version
=
v1.1
5.1
onnxruntime_version
=
v1.1
6.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
...
...
build-arm-linux-gnueabihf.sh
查看文件 @
cf199ad
#!/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: "
...
...
build-ios.sh
查看文件 @
cf199ad
...
...
@@ -5,12 +5,17 @@ set -e
dir
=
build-ios
mkdir -p
$dir
cd
$dir
onnxruntime_version
=
1.1
5.1
onnxruntime_version
=
1.1
6.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
...
...
cmake/onnxruntime-linux-aarch64.cmake
查看文件 @
cf199ad
...
...
@@ -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
)
...
...
cmake/onnxruntime-linux-arm.cmake
查看文件 @
cf199ad
...
...
@@ -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
)
...
...
cmake/onnxruntime-linux-x86_64-gpu.cmake
查看文件 @
cf199ad
...
...
@@ -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
)
...
...
cmake/onnxruntime-linux-x86_64-static.cmake
查看文件 @
cf199ad
...
...
@@ -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
)
...
...
cmake/onnxruntime-linux-x86_64.cmake
查看文件 @
cf199ad
...
...
@@ -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
)
...
...
cmake/onnxruntime-osx-arm64.cmake
查看文件 @
cf199ad
...
...
@@ -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
)
...
...
cmake/onnxruntime-osx-universal.cmake
查看文件 @
cf199ad
...
...
@@ -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
)
...
...
cmake/onnxruntime-osx-x86_64.cmake
查看文件 @
cf199ad
...
...
@@ -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
)
...
...
cmake/onnxruntime-win-x64-gpu.cmake
查看文件 @
cf199ad
...
...
@@ -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
)
...
...
cmake/onnxruntime-win-x64-static.cmake
查看文件 @
cf199ad
...
...
@@ -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.1
5.1
.tar.bz2"
)
set
(
onnxruntime_URL
"https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-win-x64-static-1.1
6.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
)
...
...
cmake/onnxruntime-win-x64.cmake
查看文件 @
cf199ad
...
...
@@ -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
)
...
...
cmake/onnxruntime-win-x86-static.cmake
查看文件 @
cf199ad
...
...
@@ -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.1
5.1
.tar.bz2"
)
set
(
onnxruntime_URL
"https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-win-x86-static-1.1
6.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
)
...
...
cmake/onnxruntime-win-x86.cmake
查看文件 @
cf199ad
...
...
@@ -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
)
...
...
ios-swift/SherpaOnnx/SherpaOnnx.xcodeproj/project.pbxproj
查看文件 @
cf199ad
...
...
@@ -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.1
5.1
/onnxruntime.xcframework"; sourceTree = "<group>"; };
C93989AF2A89FE33009AB859 /* onnxruntime.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = onnxruntime.xcframework; path = "../../build-ios/ios-onnxruntime/1.1
6.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>"; };
...
...
ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass.xcodeproj/project.pbxproj
查看文件 @
cf199ad
...
...
@@ -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.1
5.1
/onnxruntime.xcframework"; sourceTree = "<group>"; };
C9A258972AAF05E400E555CA /* onnxruntime.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = onnxruntime.xcframework; path = "../../build-ios/ios-onnxruntime/1.1
6.0
/onnxruntime.xcframework"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
...
...
scripts/dotnet/generate.py
查看文件 @
cf199ad
...
...
@@ -34,7 +34,7 @@ def get_dict():
def
process_linux
(
s
):
libs
=
[
"libkaldi-native-fbank-core.so"
,
"libonnxruntime.so.1.1
5.1
"
,
"libonnxruntime.so.1.1
6.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.1
5.1
.dylib"
,
"libonnxruntime.1.1
6.0
.dylib"
,
"libsherpa-onnx-c-api.dylib"
,
"libsherpa-onnx-core.dylib"
,
]
...
...
sherpa-onnx/c-api/c-api.h
查看文件 @
cf199ad
...
...
@@ -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.
///
...
...
请
注册
或
登录
后发表评论