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
2025-05-06 16:59:01 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2025-05-06 16:59:01 +0800
Commit
f00066db88853852c68eed81a8686cd27d934240
f00066db
1 parent
d660d5ad
Add C++ runtime for parakeet-tdt-0.6b-v2. (#2181)
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
20 行增加
和
0 行删除
sherpa-onnx/csrc/offline-recognizer-transducer-nemo-impl.h
sherpa-onnx/csrc/offline-transducer-nemo-model.cc
sherpa-onnx/csrc/offline-transducer-nemo-model.h
sherpa-onnx/csrc/offline-recognizer-transducer-nemo-impl.h
查看文件 @
f00066d
...
...
@@ -138,6 +138,12 @@ class OfflineRecognizerTransducerNeMoImpl : public OfflineRecognizerImpl {
private
:
void
PostInit
()
{
int32_t
feat_dim
=
model_
->
FeatureDim
();
if
(
feat_dim
>
0
)
{
config_
.
feat_config
.
feature_dim
=
feat_dim
;
}
config_
.
feat_config
.
nemo_normalize_type
=
model_
->
FeatureNormalizationMethod
();
...
...
sherpa-onnx/csrc/offline-transducer-nemo-model.cc
查看文件 @
f00066d
...
...
@@ -164,6 +164,8 @@ class OfflineTransducerNeMoModel::Impl {
bool
IsGigaAM
()
const
{
return
is_giga_am_
;
}
int32_t
FeatureDim
()
const
{
return
feat_dim_
;
}
private
:
void
InitEncoder
(
void
*
model_data
,
size_t
model_data_length
)
{
encoder_sess_
=
std
::
make_unique
<
Ort
::
Session
>
(
...
...
@@ -201,6 +203,7 @@ class OfflineTransducerNeMoModel::Impl {
SHERPA_ONNX_READ_META_DATA
(
pred_rnn_layers_
,
"pred_rnn_layers"
);
SHERPA_ONNX_READ_META_DATA
(
pred_hidden_
,
"pred_hidden"
);
SHERPA_ONNX_READ_META_DATA_WITH_DEFAULT
(
is_giga_am_
,
"is_giga_am"
,
0
);
SHERPA_ONNX_READ_META_DATA_WITH_DEFAULT
(
feat_dim_
,
"feat_dim"
,
-
1
);
if
(
normalize_type_
==
"NA"
)
{
normalize_type_
=
""
;
...
...
@@ -263,6 +266,11 @@ class OfflineTransducerNeMoModel::Impl {
int32_t
pred_rnn_layers_
=
-
1
;
int32_t
pred_hidden_
=
-
1
;
int32_t
is_giga_am_
=
0
;
// giga am uses 64
// parakeet-tdt-0.6b-v2 uses 128
// others use 80
int32_t
feat_dim_
=
-
1
;
// -1 means to use default values.
};
OfflineTransducerNeMoModel
::
OfflineTransducerNeMoModel
(
...
...
@@ -317,6 +325,10 @@ std::string OfflineTransducerNeMoModel::FeatureNormalizationMethod() const {
bool
OfflineTransducerNeMoModel
::
IsGigaAM
()
const
{
return
impl_
->
IsGigaAM
();
}
int32_t
OfflineTransducerNeMoModel
::
FeatureDim
()
const
{
return
impl_
->
FeatureDim
();
}
#if __ANDROID_API__ >= 9
template
OfflineTransducerNeMoModel
::
OfflineTransducerNeMoModel
(
AAssetManager
*
mgr
,
const
OfflineModelConfig
&
config
);
...
...
sherpa-onnx/csrc/offline-transducer-nemo-model.h
查看文件 @
f00066d
...
...
@@ -88,6 +88,8 @@ class OfflineTransducerNeMoModel {
bool
IsGigaAM
()
const
;
int32_t
FeatureDim
()
const
;
private
:
class
Impl
;
std
::
unique_ptr
<
Impl
>
impl_
;
...
...
请
注册
或
登录
后发表评论