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
2024-11-03 19:47:04 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-11-03 19:47:04 +0800
Commit
6ee8c99c5d3563727ba04b4c20c4fe2c8cbd2954
6ee8c99c
1 parent
f0cced1f
Fix building (#1508)
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
6 行增加
和
6 行删除
sherpa-onnx/csrc/offline-recognizer-impl.cc
sherpa-onnx/csrc/onnx-utils.cc
sherpa-onnx/csrc/session.cc
sherpa-onnx/csrc/offline-recognizer-impl.cc
查看文件 @
6ee8c99
...
...
@@ -123,7 +123,7 @@ std::unique_ptr<OfflineRecognizerImpl> OfflineRecognizerImpl::Create(
auto
model_type
=
LookupCustomModelMetaData
(
meta_data
,
"model_type"
,
allocator
);
if
(
!
model_type
.
empty
())
{
if
(
model_type
.
empty
())
{
SHERPA_ONNX_LOGE
(
"No model_type in the metadata!
\n\n
"
"Please refer to the following URLs to add metadata"
...
...
sherpa-onnx/csrc/onnx-utils.cc
查看文件 @
6ee8c99
...
...
@@ -25,7 +25,7 @@ static std::string GetInputName(Ort::Session *sess, size_t index,
OrtAllocator
*
allocator
)
{
// Note(fangjun): We only tested 1.17.1 and 1.11.0
// For other versions, we may need to change it
#if ORT_API_VERSION >= 1
7
#if ORT_API_VERSION >= 1
2
auto
v
=
sess
->
GetInputNameAllocated
(
index
,
allocator
);
return
v
.
get
();
#else
...
...
@@ -40,7 +40,7 @@ static std::string GetOutputName(Ort::Session *sess, size_t index,
OrtAllocator
*
allocator
)
{
// Note(fangjun): We only tested 1.17.1 and 1.11.0
// For other versions, we may need to change it
#if ORT_API_VERSION >= 1
7
#if ORT_API_VERSION >= 1
2
auto
v
=
sess
->
GetOutputNameAllocated
(
index
,
allocator
);
return
v
.
get
();
#else
...
...
@@ -106,7 +106,7 @@ Ort::Value GetEncoderOutFrame(OrtAllocator *allocator, Ort::Value *encoder_out,
void
PrintModelMetadata
(
std
::
ostream
&
os
,
const
Ort
::
ModelMetadata
&
meta_data
)
{
Ort
::
AllocatorWithDefaultOptions
allocator
;
#if ORT_API_VERSION >= 1
7
#if ORT_API_VERSION >= 1
2
std
::
vector
<
Ort
::
AllocatedStringPtr
>
v
=
meta_data
.
GetCustomMetadataMapKeysAllocated
(
allocator
);
for
(
const
auto
&
key
:
v
)
{
...
...
@@ -406,7 +406,7 @@ std::string LookupCustomModelMetaData(const Ort::ModelMetadata &meta_data,
OrtAllocator
*
allocator
)
{
// Note(fangjun): We only tested 1.17.1 and 1.11.0
// For other versions, we may need to change it
#if ORT_API_VERSION >= 1
7
#if ORT_API_VERSION >= 1
2
auto
v
=
meta_data
.
LookupCustomMetadataMapAllocated
(
key
,
allocator
);
return
v
.
get
();
#else
...
...
sherpa-onnx/csrc/session.cc
查看文件 @
6ee8c99
...
...
@@ -60,7 +60,7 @@ Ort::SessionOptions GetSessionOptionsImpl(
case
Provider
:
:
kCPU
:
break
;
// nothing to do for the CPU provider
case
Provider
:
:
kXnnpack
:
{
#if ORT_API_VERSION >= 1
7
#if ORT_API_VERSION >= 1
2
if
(
std
::
find
(
available_providers
.
begin
(),
available_providers
.
end
(),
"XnnpackExecutionProvider"
)
!=
available_providers
.
end
())
{
sess_opts
.
AppendExecutionProvider
(
"XNNPACK"
);
...
...
请
注册
或
登录
后发表评论