Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
5e03d753
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 2 年 前同步成功
通知
210
Star
8425
Fork
1598
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
245
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DeepSpeech
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
245
Issue
245
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5e03d753
编写于
6月 16, 2022
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add ds2 steaming asr onnx
上级
9106daa2
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
27 addition
and
14 deletion
+27
-14
demos/streaming_asr_server/conf/ws_ds2_application.yaml
demos/streaming_asr_server/conf/ws_ds2_application.yaml
+3
-3
paddlespeech/resource/resource.py
paddlespeech/resource/resource.py
+0
-1
paddlespeech/server/conf/ws_ds2_application.yaml
paddlespeech/server/conf/ws_ds2_application.yaml
+5
-5
paddlespeech/server/engine/asr/online/onnx/asr_engine.py
paddlespeech/server/engine/asr/online/onnx/asr_engine.py
+13
-5
paddlespeech/server/engine/asr/online/paddleinference/asr_engine.py
...ch/server/engine/asr/online/paddleinference/asr_engine.py
+6
-0
未找到文件。
demos/streaming_asr_server/conf/ws_ds2_application.yaml
浏览文件 @
5e03d753
...
...
@@ -22,8 +22,8 @@ engine_list: ['asr_online-inference']
################### speech task: asr; engine_type: online-inference #######################
asr_online-inference
:
model_type
:
'
deepspeech2online_aishell'
am_model
:
# the pdmodel file of am static model [optional]
am_params
:
# the pdiparams file of am static model [optional]
am_model
:
# the pdmodel file of am static model [optional]
am_params
:
# the pdiparams file of am static model [optional]
lang
:
'
zh'
sample_rate
:
16000
cfg_path
:
...
...
@@ -54,7 +54,7 @@ asr_online-inference:
################### speech task: asr; engine_type: online-onnx #######################
asr_online-onnx
:
model_type
:
'
deepspeech2online_aishell'
am_model
:
# the pdmodel file of am static model [optional]
am_model
:
# the pdmodel file of
onnx
am static model [optional]
am_params
:
# the pdiparams file of am static model [optional]
lang
:
'
zh'
sample_rate
:
16000
...
...
paddlespeech/resource/resource.py
浏览文件 @
5e03d753
...
...
@@ -168,7 +168,6 @@ class CommonTaskResource:
exec
(
'from .pretrained_models import {}'
.
format
(
import_models
))
models
=
OrderedDict
(
locals
()[
import_models
])
except
Exception
as
e
:
print
(
e
)
models
=
OrderedDict
({})
# no models.
finally
:
return
models
...
...
paddlespeech/server/conf/ws_ds2_application.yaml
浏览文件 @
5e03d753
...
...
@@ -11,7 +11,7 @@ port: 8090
# protocol = ['websocket'] (only one can be selected).
# websocket only support online engine type.
protocol
:
'
websocket'
engine_list
:
[
'
asr_online-
onnx
'
]
engine_list
:
[
'
asr_online-
inference
'
]
#################################################################################
...
...
@@ -22,8 +22,8 @@ engine_list: ['asr_online-onnx']
################### speech task: asr; engine_type: online-inference #######################
asr_online-inference
:
model_type
:
'
deepspeech2online_aishell'
am_model
:
# the pdmodel file of am static model [optional]
am_params
:
# the pdiparams file of am static model [optional]
am_model
:
# the pdmodel file of am static model [optional]
am_params
:
# the pdiparams file of am static model [optional]
lang
:
'
zh'
sample_rate
:
16000
cfg_path
:
...
...
@@ -54,7 +54,7 @@ asr_online-inference:
################### speech task: asr; engine_type: online-onnx #######################
asr_online-onnx
:
model_type
:
'
deepspeech2online_aishell'
am_model
:
# the pdmodel file of am static model [optional]
am_model
:
# the pdmodel file of
onnx
am static model [optional]
am_params
:
# the pdiparams file of am static model [optional]
lang
:
'
zh'
sample_rate
:
16000
...
...
@@ -81,4 +81,4 @@ asr_online-onnx:
window_n
:
7
# frame
shift_n
:
4
# frame
window_ms
:
20
# ms
shift_ms
:
10
# ms
shift_ms
:
10
# ms
\ No newline at end of file
paddlespeech/server/engine/asr/online/onnx/asr_engine.py
浏览文件 @
5e03d753
...
...
@@ -331,6 +331,13 @@ class PaddleASRConnectionHanddler:
else
:
return
''
def
get_word_time_stamp
(
self
):
return
[]
@
paddle
.
no_grad
()
def
rescoring
(
self
):
...
class
ASRServerExecutor
(
ASRExecutor
):
def
__init__
(
self
):
...
...
@@ -409,17 +416,18 @@ class ASRServerExecutor(ASRExecutor):
os
.
path
.
dirname
(
os
.
path
.
abspath
(
self
.
cfg_path
)))
self
.
am_model
=
os
.
path
.
join
(
self
.
res_path
,
self
.
task_resource
.
res_dict
[
'model'
])
if
am_model
is
None
else
os
.
path
.
abspath
(
am_model
)
self
.
am_params
=
os
.
path
.
join
(
self
.
res_path
,
self
.
task_resource
.
res_dict
[
'params'
])
if
am_params
is
None
else
os
.
path
.
abspath
(
am_params
)
'onnx_model'
])
if
am_model
is
None
else
os
.
path
.
abspath
(
am_model
)
# self.am_params = os.path.join(
# self.res_path, self.task_resource.res_dict[
# 'params']) if am_params is None else os.path.abspath(am_params)
logger
.
info
(
"Load the pretrained model:"
)
logger
.
info
(
f
" tag =
{
tag
}
"
)
logger
.
info
(
f
" res_path:
{
self
.
res_path
}
"
)
logger
.
info
(
f
" cfg path:
{
self
.
cfg_path
}
"
)
logger
.
info
(
f
" am_model path:
{
self
.
am_model
}
"
)
logger
.
info
(
f
" am_params path:
{
self
.
am_params
}
"
)
#
logger.info(f" am_params path: {self.am_params}")
#Init body.
self
.
config
=
CfgNode
(
new_allowed
=
True
)
...
...
paddlespeech/server/engine/asr/online/paddleinference/asr_engine.py
浏览文件 @
5e03d753
...
...
@@ -345,6 +345,12 @@ class PaddleASRConnectionHanddler:
else
:
return
''
def
get_word_time_stamp
(
self
):
return
[]
@
paddle
.
no_grad
()
def
rescoring
(
self
):
...
class
ASRServerExecutor
(
ASRExecutor
):
def
__init__
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录