Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
7394a187
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
12 个月 前同步成功
通知
205
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7394a187
编写于
12月 15, 2021
作者:
K
KP
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add default arguments in cls python api.
上级
f9efbf30
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
33 addition
and
14 deletion
+33
-14
paddlespeech/cli/asr/infer.py
paddlespeech/cli/asr/infer.py
+9
-3
paddlespeech/cli/cls/infer.py
paddlespeech/cli/cls/infer.py
+9
-3
paddlespeech/cli/st/infer.py
paddlespeech/cli/st/infer.py
+11
-4
paddlespeech/cli/text/infer.py
paddlespeech/cli/text/infer.py
+3
-3
paddlespeech/cli/tts/infer.py
paddlespeech/cli/tts/infer.py
+1
-1
未找到文件。
paddlespeech/cli/asr/infer.py
浏览文件 @
7394a187
...
...
@@ -421,7 +421,7 @@ class ASRExecutor(BaseExecutor):
device
=
parser_args
.
device
try
:
res
=
self
(
model
,
lang
,
sample_rate
,
config
,
ckpt_path
,
audio_file
,
res
=
self
(
audio_file
,
model
,
lang
,
sample_rate
,
config
,
ckpt_path
,
device
)
logger
.
info
(
'ASR Result: {}'
.
format
(
res
))
return
True
...
...
@@ -429,8 +429,14 @@ class ASRExecutor(BaseExecutor):
logger
.
exception
(
e
)
return
False
def
__call__
(
self
,
model
,
lang
,
sample_rate
,
config
,
ckpt_path
,
audio_file
,
device
):
def
__call__
(
self
,
audio_file
:
os
.
PathLike
,
model
:
str
=
'conformer_wenetspeech'
,
lang
:
str
=
'zh'
,
sample_rate
:
int
=
16000
,
config
:
os
.
PathLike
=
None
,
ckpt_path
:
os
.
PathLike
=
None
,
device
=
paddle
.
get_device
()):
"""
Python API to call an executor.
"""
...
...
paddlespeech/cli/cls/infer.py
浏览文件 @
7394a187
...
...
@@ -237,7 +237,7 @@ class CLSExecutor(BaseExecutor):
device
=
parser_args
.
device
try
:
res
=
self
(
model_type
,
cfg_path
,
label_file
,
ckpt_path
,
audio
_file
,
res
=
self
(
audio_file
,
model_type
,
cfg_path
,
ckpt_path
,
label
_file
,
topk
,
device
)
logger
.
info
(
'CLS Result:
\n
{}'
.
format
(
res
))
return
True
...
...
@@ -245,8 +245,14 @@ class CLSExecutor(BaseExecutor):
logger
.
exception
(
e
)
return
False
def
__call__
(
self
,
model
,
config
,
ckpt_path
,
label_file
,
audio_file
,
topk
,
device
):
def
__call__
(
self
,
audio_file
:
os
.
PathLike
,
model
:
str
=
'panns_cnn14'
,
config
:
Optional
[
os
.
PathLike
]
=
None
,
ckpt_path
:
Optional
[
os
.
PathLike
]
=
None
,
label_file
:
Optional
[
os
.
PathLike
]
=
None
,
topk
:
int
=
1
,
device
:
str
=
paddle
.
get_device
()):
"""
Python API to call an executor.
"""
...
...
paddlespeech/cli/st/infer.py
浏览文件 @
7394a187
...
...
@@ -326,16 +326,23 @@ class STExecutor(BaseExecutor):
device
=
parser_args
.
device
try
:
res
=
self
(
model
,
src_lang
,
tgt_lang
,
sample_rate
,
config
,
c
kpt_path
,
audio_file
,
device
)
res
=
self
(
audio_file
,
model
,
src_lang
,
tgt_lang
,
sample_rate
,
c
onfig
,
ckpt_path
,
device
)
logger
.
info
(
"ST Result: {}"
.
format
(
res
))
return
True
except
Exception
as
e
:
logger
.
exception
(
e
)
return
False
def
__call__
(
self
,
model
,
src_lang
,
tgt_lang
,
sample_rate
,
config
,
ckpt_path
,
audio_file
,
device
):
def
__call__
(
self
,
audio_file
:
os
.
PathLike
,
model
:
str
=
'fat_st_ted'
,
src_lang
:
str
=
'en'
,
tgt_lang
:
str
=
'zh'
,
sample_rate
:
int
=
16000
,
config
:
Optional
[
os
.
PathLike
]
=
None
,
ckpt_path
:
Optional
[
os
.
PathLike
]
=
None
,
device
:
str
=
paddle
.
get_device
()):
"""
Python API to call an executor.
"""
...
...
paddlespeech/cli/text/infer.py
浏览文件 @
7394a187
...
...
@@ -265,9 +265,9 @@ class TextExecutor(BaseExecutor):
task
:
str
=
'punc'
,
model
:
str
=
'ernie_linear_wudao'
,
lang
:
str
=
'zh'
,
config
:
os
.
PathLike
=
None
,
ckpt_path
:
os
.
PathLike
=
None
,
punc_vocab
:
os
.
PathLike
=
None
,
config
:
Optional
[
os
.
PathLike
]
=
None
,
ckpt_path
:
Optional
[
os
.
PathLike
]
=
None
,
punc_vocab
:
Optional
[
os
.
PathLike
]
=
None
,
device
:
str
=
paddle
.
get_device
(),
):
"""
Python API to call an executor.
...
...
paddlespeech/cli/tts/infer.py
浏览文件 @
7394a187
...
...
@@ -616,7 +616,7 @@ class TTSExecutor(BaseExecutor):
voc_ckpt
:
Optional
[
os
.
PathLike
]
=
None
,
voc_stat
:
Optional
[
os
.
PathLike
]
=
None
,
lang
:
str
=
'zh'
,
device
:
str
=
'gpu'
,
device
:
str
=
paddle
.
get_device
()
,
output
:
str
=
'output.wav'
):
"""
Python API to call an executor.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录