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-03-18 13:55:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2023-03-18 13:55:59 +0800
Commit
6f92bc73624f4f50736ac3f73c98d9105bc2be81
6f92bc73
1 parent
355c5ef5
Fix issues about DLLs when installing pre-compiled wheels on windows (#91)
隐藏空白字符变更
内嵌
并排对比
正在显示
7 个修改的文件
包含
100 行增加
和
9 行删除
.github/workflows/test-pip-install.yaml
CMakeLists.txt
cmake/cmake_extension.py
cmake/kaldi-native-fbank.cmake
cmake/onnxruntime.cmake
sherpa-onnx/csrc/CMakeLists.txt
sherpa-onnx/csrc/online-transducer-model.h
.github/workflows/test-pip-install.yaml
0 → 100644
查看文件 @
6f92bc7
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
*
*
*"
concurrency
:
group
:
test-pip-install-${{ github.ref }}
cancel-in-progress
:
true
permissions
:
contents
:
read
jobs
:
test_pip_install
:
runs-on
:
${{ matrix.os }}
name
:
Test pip install on ${{ matrix.os }}
strategy
:
fail-fast
:
false
matrix
:
os
:
[
ubuntu-latest
,
windows-latest
,
macos-latest
]
python-version
:
[
"
3.7"
,
"
3.8"
,
"
3.9"
,
"
3.10"
]
steps
:
-
uses
:
actions/checkout@v2
with
:
fetch-depth
:
0
-
name
:
Setup Python ${{ matrix.python-version }}
uses
:
actions/setup-python@v2
with
:
python-version
:
${{ matrix.python-version }}
-
name
:
Install sherpa-onnx
shell
:
bash
run
:
|
pip install --verbose sherpa-onnx
-
name
:
Test sherp-onnx
shell
:
bash
run
:
|
python3 -c "import sherpa_onnx; print(sherpa_onnx.__file__)"
python3 -c "import sherpa_onnx; print(sherpa_onnx.__version__)"
...
...
CMakeLists.txt
查看文件 @
6f92bc7
cmake_minimum_required
(
VERSION 3.13 FATAL_ERROR
)
project
(
sherpa-onnx
)
set
(
SHERPA_ONNX_VERSION
"1.3.
0
"
)
set
(
SHERPA_ONNX_VERSION
"1.3.
2
"
)
# Disable warning about
#
...
...
@@ -74,9 +74,37 @@ endif()
check_include_file_cxx
(
cxxabi.h SHERPA_ONNX_HAVE_CXXABI_H
)
check_include_file_cxx
(
execinfo.h SHERPA_ONNX_HAVE_EXECINFO_H
)
if
(
WIN32
)
add_definitions
(
-DNOMINMAX
)
# Otherwise, std::max() and std::min() won't work
endif
()
if
(
WIN32 AND MSVC
)
# disable various warnings for MSVC
# 4244: 'return': conversion from 'unsigned __int64' to 'int', possible loss of data
# 4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
# 4305: 'argument': truncation from 'double' to 'const float'
# 4334: '<<': result of 32-bit shift implicitly converted to 64 bits
# 4800: 'int': forcing value to bool 'true' or 'false'
# 4996: 'fopen': This function or variable may be unsafe
set
(
disabled_warnings
/wd4244
/wd4267
/wd4305
/wd4334
/wd4800
/wd4996
)
message
(
STATUS
"Disabled warnings:
${
disabled_warnings
}
"
)
foreach
(
w IN LISTS disabled_warnings
)
string
(
APPEND CMAKE_CXX_FLAGS
"
${
w
}
"
)
endforeach
()
endif
()
list
(
APPEND CMAKE_MODULE_PATH
${
CMAKE_SOURCE_DIR
}
/cmake/Modules
)
list
(
APPEND CMAKE_MODULE_PATH
${
CMAKE_SOURCE_DIR
}
/cmake
)
include
(
kaldi-native-fbank
)
include
(
onnxruntime
)
...
...
cmake/cmake_extension.py
查看文件 @
6f92bc7
...
...
@@ -71,10 +71,8 @@ class BuildExtension(build_ext):
cmake_args
=
"-DCMAKE_BUILD_TYPE=Release"
extra_cmake_args
=
f
" -DCMAKE_INSTALL_PREFIX={install_dir} "
if
not
is_windows
():
extra_cmake_args
+=
" -DBUILD_SHARED_LIBS=ON "
else
:
extra_cmake_args
+=
" -DBUILD_SHARED_LIBS=OFF "
extra_cmake_args
+=
" -DBUILD_SHARED_LIBS=ON "
extra_cmake_args
+=
" -DSHERPA_ONNX_ENABLE_CHECK=OFF "
extra_cmake_args
+=
" -DSHERPA_ONNX_ENABLE_PYTHON=ON "
extra_cmake_args
+=
" -DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF "
...
...
cmake/kaldi-native-fbank.cmake
查看文件 @
6f92bc7
...
...
@@ -49,7 +49,11 @@ function(download_kaldi_native_fbank)
INTERFACE
${
kaldi_native_fbank_SOURCE_DIR
}
/
)
install
(
TARGETS kaldi-native-fbank-core DESTINATION lib
)
if
(
SHERPA_ONNX_ENABLE_PYTHON AND WIN32
)
install
(
TARGETS kaldi-native-fbank-core DESTINATION ..
)
else
()
install
(
TARGETS kaldi-native-fbank-core DESTINATION lib
)
endif
()
endfunction
()
download_kaldi_native_fbank
()
...
...
cmake/onnxruntime.cmake
查看文件 @
6f92bc7
...
...
@@ -155,7 +155,11 @@ function(download_onnxruntime)
endif
()
message
(
STATUS
"onnxruntime lib files:
${
onnxruntime_lib_files
}
"
)
install
(
FILES
${
onnxruntime_lib_files
}
DESTINATION lib
)
if
(
SHERPA_ONNX_ENABLE_PYTHON AND WIN32
)
install
(
FILES
${
onnxruntime_lib_files
}
DESTINATION ..
)
else
()
install
(
FILES
${
onnxruntime_lib_files
}
DESTINATION lib
)
endif
()
endfunction
()
# First, we try to locate the header and the lib if the use has already
...
...
sherpa-onnx/csrc/CMakeLists.txt
查看文件 @
6f92bc7
...
...
@@ -62,7 +62,12 @@ if(NOT WIN32)
target_link_libraries
(
sherpa-onnx
"-Wl,-rpath,
${
SHERPA_ONNX_RPATH_ORIGIN
}
/../lib"
)
endif
()
install
(
TARGETS sherpa-onnx-core DESTINATION lib
)
if
(
SHERPA_ONNX_ENABLE_PYTHON AND WIN32
)
install
(
TARGETS sherpa-onnx-core DESTINATION ..
)
else
()
install
(
TARGETS sherpa-onnx-core DESTINATION lib
)
endif
()
install
(
TARGETS sherpa-onnx DESTINATION bin
)
if
(
SHERPA_ONNX_HAS_ALSA
)
...
...
sherpa-onnx/csrc/online-transducer-model.h
查看文件 @
6f92bc7
...
...
@@ -20,7 +20,7 @@
namespace
sherpa_onnx
{
class
OnlineTransducerDecoderResult
;
struct
OnlineTransducerDecoderResult
;
class
OnlineTransducerModel
{
public
:
...
...
请
注册
或
登录
后发表评论