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-08-30 12:50:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-08-30 12:50:34 +0800
Commit
3687c9f60a31956b3e242ea40f8bbaf57919d7c8
3687c9f6
1 parent
6b8877f1
Reduce onnxruntime log output. (#1306)
Change the logging level from WARNING to ERROR.
隐藏空白字符变更
内嵌
并排对比
正在显示
17 个修改的文件
包含
32 行增加
和
32 行删除
sherpa-onnx/csrc/offline-ctc-model.cc
sherpa-onnx/csrc/offline-transducer-model.cc
sherpa-onnx/csrc/offline-transducer-nemo-model.cc
sherpa-onnx/csrc/offline-tts-vits-model.cc
sherpa-onnx/csrc/online-conformer-transducer-model.cc
sherpa-onnx/csrc/online-lstm-transducer-model.cc
sherpa-onnx/csrc/online-nemo-ctc-model.cc
sherpa-onnx/csrc/online-paraformer-model.cc
sherpa-onnx/csrc/online-recognizer-impl.cc
sherpa-onnx/csrc/online-transducer-model.cc
sherpa-onnx/csrc/online-transducer-nemo-model.cc
sherpa-onnx/csrc/online-wenet-ctc-model.cc
sherpa-onnx/csrc/online-zipformer-transducer-model.cc
sherpa-onnx/csrc/online-zipformer2-ctc-model.cc
sherpa-onnx/csrc/online-zipformer2-transducer-model.cc
sherpa-onnx/csrc/speaker-embedding-extractor-impl.cc
sherpa-onnx/csrc/spoken-language-identification-impl.cc
sherpa-onnx/csrc/offline-ctc-model.cc
查看文件 @
3687c9f
...
...
@@ -35,7 +35,7 @@ namespace sherpa_onnx {
static
ModelType
GetModelType
(
char
*
model_data
,
size_t
model_data_length
,
bool
debug
)
{
Ort
::
Env
env
(
ORT_LOGGING_LEVEL_
WARNING
);
Ort
::
Env
env
(
ORT_LOGGING_LEVEL_
ERROR
);
Ort
::
SessionOptions
sess_opts
;
sess_opts
.
SetIntraOpNumThreads
(
1
);
sess_opts
.
SetInterOpNumThreads
(
1
);
...
...
sherpa-onnx/csrc/offline-transducer-model.cc
查看文件 @
3687c9f
...
...
@@ -19,7 +19,7 @@ class OfflineTransducerModel::Impl {
public
:
explicit
Impl
(
const
OfflineModelConfig
&
config
)
:
config_
(
config
),
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
{
...
...
@@ -41,7 +41,7 @@ class OfflineTransducerModel::Impl {
#if __ANDROID_API__ >= 9
Impl
(
AAssetManager
*
mgr
,
const
OfflineModelConfig
&
config
)
:
config_
(
config
),
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
{
...
...
sherpa-onnx/csrc/offline-transducer-nemo-model.cc
查看文件 @
3687c9f
...
...
@@ -21,7 +21,7 @@ class OfflineTransducerNeMoModel::Impl {
public
:
explicit
Impl
(
const
OfflineModelConfig
&
config
)
:
config_
(
config
),
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
{
...
...
@@ -43,7 +43,7 @@ class OfflineTransducerNeMoModel::Impl {
#if __ANDROID_API__ >= 9
Impl
(
AAssetManager
*
mgr
,
const
OfflineModelConfig
&
config
)
:
config_
(
config
),
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
{
...
...
sherpa-onnx/csrc/offline-tts-vits-model.cc
查看文件 @
3687c9f
...
...
@@ -19,7 +19,7 @@ class OfflineTtsVitsModel::Impl {
public
:
explicit
Impl
(
const
OfflineTtsModelConfig
&
config
)
:
config_
(
config
),
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
auto
buf
=
ReadFile
(
config
.
vits
.
model
);
...
...
@@ -29,7 +29,7 @@ class OfflineTtsVitsModel::Impl {
#if __ANDROID_API__ >= 9
Impl
(
AAssetManager
*
mgr
,
const
OfflineTtsModelConfig
&
config
)
:
config_
(
config
),
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
auto
buf
=
ReadFile
(
mgr
,
config
.
vits
.
model
);
...
...
sherpa-onnx/csrc/online-conformer-transducer-model.cc
查看文件 @
3687c9f
...
...
@@ -30,7 +30,7 @@ namespace sherpa_onnx {
OnlineConformerTransducerModel
::
OnlineConformerTransducerModel
(
const
OnlineModelConfig
&
config
)
:
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
:
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
config_
(
config
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
...
...
@@ -53,7 +53,7 @@ OnlineConformerTransducerModel::OnlineConformerTransducerModel(
#if __ANDROID_API__ >= 9
OnlineConformerTransducerModel
::
OnlineConformerTransducerModel
(
AAssetManager
*
mgr
,
const
OnlineModelConfig
&
config
)
:
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
:
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
config_
(
config
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
...
...
sherpa-onnx/csrc/online-lstm-transducer-model.cc
查看文件 @
3687c9f
...
...
@@ -28,7 +28,7 @@ namespace sherpa_onnx {
OnlineLstmTransducerModel
::
OnlineLstmTransducerModel
(
const
OnlineModelConfig
&
config
)
:
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
:
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
config_
(
config
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
...
...
@@ -51,7 +51,7 @@ OnlineLstmTransducerModel::OnlineLstmTransducerModel(
#if __ANDROID_API__ >= 9
OnlineLstmTransducerModel
::
OnlineLstmTransducerModel
(
AAssetManager
*
mgr
,
const
OnlineModelConfig
&
config
)
:
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
:
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
config_
(
config
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
...
...
sherpa-onnx/csrc/online-nemo-ctc-model.cc
查看文件 @
3687c9f
...
...
@@ -39,7 +39,7 @@ class OnlineNeMoCtcModel::Impl {
#if __ANDROID_API__ >= 9
Impl
(
AAssetManager
*
mgr
,
const
OnlineModelConfig
&
config
)
:
config_
(
config
),
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
{
...
...
sherpa-onnx/csrc/online-paraformer-model.cc
查看文件 @
3687c9f
...
...
@@ -41,7 +41,7 @@ class OnlineParaformerModel::Impl {
#if __ANDROID_API__ >= 9
Impl
(
AAssetManager
*
mgr
,
const
OnlineModelConfig
&
config
)
:
config_
(
config
),
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
{
...
...
sherpa-onnx/csrc/online-recognizer-impl.cc
查看文件 @
3687c9f
...
...
@@ -28,7 +28,7 @@ namespace sherpa_onnx {
std
::
unique_ptr
<
OnlineRecognizerImpl
>
OnlineRecognizerImpl
::
Create
(
const
OnlineRecognizerConfig
&
config
)
{
if
(
!
config
.
model_config
.
transducer
.
encoder
.
empty
())
{
Ort
::
Env
env
(
ORT_LOGGING_LEVEL_
WARNING
);
Ort
::
Env
env
(
ORT_LOGGING_LEVEL_
ERROR
);
auto
decoder_model
=
ReadFile
(
config
.
model_config
.
transducer
.
decoder
);
auto
sess
=
std
::
make_unique
<
Ort
::
Session
>
(
...
...
@@ -61,7 +61,7 @@ std::unique_ptr<OnlineRecognizerImpl> OnlineRecognizerImpl::Create(
std
::
unique_ptr
<
OnlineRecognizerImpl
>
OnlineRecognizerImpl
::
Create
(
AAssetManager
*
mgr
,
const
OnlineRecognizerConfig
&
config
)
{
if
(
!
config
.
model_config
.
transducer
.
encoder
.
empty
())
{
Ort
::
Env
env
(
ORT_LOGGING_LEVEL_
WARNING
);
Ort
::
Env
env
(
ORT_LOGGING_LEVEL_
ERROR
);
auto
decoder_model
=
ReadFile
(
mgr
,
config
.
model_config
.
transducer
.
decoder
);
auto
sess
=
std
::
make_unique
<
Ort
::
Session
>
(
...
...
sherpa-onnx/csrc/online-transducer-model.cc
查看文件 @
3687c9f
...
...
@@ -37,7 +37,7 @@ namespace sherpa_onnx {
static
ModelType
GetModelType
(
char
*
model_data
,
size_t
model_data_length
,
bool
debug
)
{
Ort
::
Env
env
(
ORT_LOGGING_LEVEL_
WARNING
);
Ort
::
Env
env
(
ORT_LOGGING_LEVEL_
ERROR
);
Ort
::
SessionOptions
sess_opts
;
sess_opts
.
SetIntraOpNumThreads
(
1
);
sess_opts
.
SetInterOpNumThreads
(
1
);
...
...
sherpa-onnx/csrc/online-transducer-nemo-model.cc
查看文件 @
3687c9f
...
...
@@ -35,7 +35,7 @@ class OnlineTransducerNeMoModel::Impl {
public
:
explicit
Impl
(
const
OnlineModelConfig
&
config
)
:
config_
(
config
),
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
{
...
...
@@ -57,7 +57,7 @@ class OnlineTransducerNeMoModel::Impl {
#if __ANDROID_API__ >= 9
Impl
(
AAssetManager
*
mgr
,
const
OnlineModelConfig
&
config
)
:
config_
(
config
),
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
{
...
...
sherpa-onnx/csrc/online-wenet-ctc-model.cc
查看文件 @
3687c9f
...
...
@@ -36,7 +36,7 @@ class OnlineWenetCtcModel::Impl {
#if __ANDROID_API__ >= 9
Impl
(
AAssetManager
*
mgr
,
const
OnlineModelConfig
&
config
)
:
config_
(
config
),
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
{
...
...
sherpa-onnx/csrc/online-zipformer-transducer-model.cc
查看文件 @
3687c9f
...
...
@@ -30,7 +30,7 @@ namespace sherpa_onnx {
OnlineZipformerTransducerModel
::
OnlineZipformerTransducerModel
(
const
OnlineModelConfig
&
config
)
:
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
:
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
config_
(
config
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
...
...
@@ -53,7 +53,7 @@ OnlineZipformerTransducerModel::OnlineZipformerTransducerModel(
#if __ANDROID_API__ >= 9
OnlineZipformerTransducerModel
::
OnlineZipformerTransducerModel
(
AAssetManager
*
mgr
,
const
OnlineModelConfig
&
config
)
:
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
:
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
config_
(
config
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
...
...
sherpa-onnx/csrc/online-zipformer2-ctc-model.cc
查看文件 @
3687c9f
...
...
@@ -40,7 +40,7 @@ class OnlineZipformer2CtcModel::Impl {
#if __ANDROID_API__ >= 9
Impl
(
AAssetManager
*
mgr
,
const
OnlineModelConfig
&
config
)
:
config_
(
config
),
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
sess_opts_
(
GetSessionOptions
(
config
)),
allocator_
{}
{
{
...
...
sherpa-onnx/csrc/online-zipformer2-transducer-model.cc
查看文件 @
3687c9f
...
...
@@ -32,7 +32,7 @@ namespace sherpa_onnx {
OnlineZipformer2TransducerModel
::
OnlineZipformer2TransducerModel
(
const
OnlineModelConfig
&
config
)
:
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
:
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
encoder_sess_opts_
(
GetSessionOptions
(
config
)),
decoder_sess_opts_
(
GetSessionOptions
(
config
,
"decoder"
)),
joiner_sess_opts_
(
GetSessionOptions
(
config
,
"joiner"
)),
...
...
@@ -57,7 +57,7 @@ OnlineZipformer2TransducerModel::OnlineZipformer2TransducerModel(
#if __ANDROID_API__ >= 9
OnlineZipformer2TransducerModel
::
OnlineZipformer2TransducerModel
(
AAssetManager
*
mgr
,
const
OnlineModelConfig
&
config
)
:
env_
(
ORT_LOGGING_LEVEL_
WARNING
),
:
env_
(
ORT_LOGGING_LEVEL_
ERROR
),
config_
(
config
),
encoder_sess_opts_
(
GetSessionOptions
(
config
)),
decoder_sess_opts_
(
GetSessionOptions
(
config
)),
...
...
@@ -82,8 +82,8 @@ OnlineZipformer2TransducerModel::OnlineZipformer2TransducerModel(
void
OnlineZipformer2TransducerModel
::
InitEncoder
(
void
*
model_data
,
size_t
model_data_length
)
{
encoder_sess_
=
std
::
make_unique
<
Ort
::
Session
>
(
env_
,
model_data
,
model_data_length
,
encoder_sess_opts_
);
encoder_sess_
=
std
::
make_unique
<
Ort
::
Session
>
(
env_
,
model_data
,
model_data_length
,
encoder_sess_opts_
);
GetInputNames
(
encoder_sess_
.
get
(),
&
encoder_input_names_
,
&
encoder_input_names_ptr_
);
...
...
@@ -135,8 +135,8 @@ void OnlineZipformer2TransducerModel::InitEncoder(void *model_data,
void
OnlineZipformer2TransducerModel
::
InitDecoder
(
void
*
model_data
,
size_t
model_data_length
)
{
decoder_sess_
=
std
::
make_unique
<
Ort
::
Session
>
(
env_
,
model_data
,
model_data_length
,
decoder_sess_opts_
);
decoder_sess_
=
std
::
make_unique
<
Ort
::
Session
>
(
env_
,
model_data
,
model_data_length
,
decoder_sess_opts_
);
GetInputNames
(
decoder_sess_
.
get
(),
&
decoder_input_names_
,
&
decoder_input_names_ptr_
);
...
...
@@ -160,8 +160,8 @@ void OnlineZipformer2TransducerModel::InitDecoder(void *model_data,
void
OnlineZipformer2TransducerModel
::
InitJoiner
(
void
*
model_data
,
size_t
model_data_length
)
{
joiner_sess_
=
std
::
make_unique
<
Ort
::
Session
>
(
env_
,
model_data
,
model_data_length
,
joiner_sess_opts_
);
joiner_sess_
=
std
::
make_unique
<
Ort
::
Session
>
(
env_
,
model_data
,
model_data_length
,
joiner_sess_opts_
);
GetInputNames
(
joiner_sess_
.
get
(),
&
joiner_input_names_
,
&
joiner_input_names_ptr_
);
...
...
sherpa-onnx/csrc/speaker-embedding-extractor-impl.cc
查看文件 @
3687c9f
...
...
@@ -23,7 +23,7 @@ enum class ModelType : std::uint8_t {
static
ModelType
GetModelType
(
char
*
model_data
,
size_t
model_data_length
,
bool
debug
)
{
Ort
::
Env
env
(
ORT_LOGGING_LEVEL_
WARNING
);
Ort
::
Env
env
(
ORT_LOGGING_LEVEL_
ERROR
);
Ort
::
SessionOptions
sess_opts
;
sess_opts
.
SetIntraOpNumThreads
(
1
);
sess_opts
.
SetInterOpNumThreads
(
1
);
...
...
sherpa-onnx/csrc/spoken-language-identification-impl.cc
查看文件 @
3687c9f
...
...
@@ -27,7 +27,7 @@ enum class ModelType : std::uint8_t {
static
ModelType
GetModelType
(
char
*
model_data
,
size_t
model_data_length
,
bool
debug
)
{
Ort
::
Env
env
(
ORT_LOGGING_LEVEL_
WARNING
);
Ort
::
Env
env
(
ORT_LOGGING_LEVEL_
ERROR
);
Ort
::
SessionOptions
sess_opts
;
auto
sess
=
std
::
make_unique
<
Ort
::
Session
>
(
env
,
model_data
,
model_data_length
,
...
...
请
注册
或
登录
后发表评论