Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
5ca05fea
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看板
提交
5ca05fea
编写于
7月 08, 2022
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cli batch process support \t
上级
fb40602d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
7 deletion
+9
-7
paddlespeech/cli/asr/infer.py
paddlespeech/cli/asr/infer.py
+1
-1
paddlespeech/cli/executor.py
paddlespeech/cli/executor.py
+8
-6
未找到文件。
paddlespeech/cli/asr/infer.py
浏览文件 @
5ca05fea
...
@@ -365,7 +365,7 @@ class ASRExecutor(BaseExecutor):
...
@@ -365,7 +365,7 @@ class ASRExecutor(BaseExecutor):
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
exception
(
e
)
logger
.
exception
(
e
)
logger
.
error
(
logger
.
error
(
"can not open the audio file, please check the audio file
format is 'wav'.
\n
\
f
"can not open the audio file, please check the audio file(
{
audio_file
}
)
format is 'wav'.
\n
\
you can try to use sox to change the file format.
\n
\
you can try to use sox to change the file format.
\n
\
For example:
\n
\
For example:
\n
\
sample rate: 16k
\n
\
sample rate: 16k
\n
\
...
...
paddlespeech/cli/executor.py
浏览文件 @
5ca05fea
...
@@ -108,19 +108,20 @@ class BaseExecutor(ABC):
...
@@ -108,19 +108,20 @@ class BaseExecutor(ABC):
Dict[str, Union[str, os.PathLike]]: A dict with ids and inputs.
Dict[str, Union[str, os.PathLike]]: A dict with ids and inputs.
"""
"""
if
self
.
_is_job_input
(
input_
):
if
self
.
_is_job_input
(
input_
):
# .job/.scp/.txt file
ret
=
self
.
_get_job_contents
(
input_
)
ret
=
self
.
_get_job_contents
(
input_
)
else
:
else
:
# job from stdin
ret
=
OrderedDict
()
ret
=
OrderedDict
()
if
input_
is
None
:
# Take input from stdin
if
input_
is
None
:
# Take input from stdin
if
not
sys
.
stdin
.
isatty
(
if
not
sys
.
stdin
.
isatty
(
):
# Avoid getting stuck when stdin is empty.
):
# Avoid getting stuck when stdin is empty.
for
i
,
line
in
enumerate
(
sys
.
stdin
):
for
i
,
line
in
enumerate
(
sys
.
stdin
):
line
=
line
.
strip
()
line
=
line
.
strip
()
if
len
(
line
.
split
(
' '
))
==
1
:
if
len
(
line
.
split
())
==
1
:
ret
[
str
(
i
+
1
)]
=
line
ret
[
str
(
i
+
1
)]
=
line
elif
len
(
line
.
split
(
' '
))
==
2
:
elif
len
(
line
.
split
())
==
2
:
id_
,
info
=
line
.
split
(
' '
)
id_
,
info
=
line
.
split
()
ret
[
id_
]
=
info
ret
[
id_
]
=
info
else
:
# No valid input info from one line.
else
:
# No valid input info from one line.
continue
continue
...
@@ -170,7 +171,8 @@ class BaseExecutor(ABC):
...
@@ -170,7 +171,8 @@ class BaseExecutor(ABC):
bool: return `True` for job input, `False` otherwise.
bool: return `True` for job input, `False` otherwise.
"""
"""
return
input_
and
os
.
path
.
isfile
(
input_
)
and
(
input_
.
endswith
(
'.job'
)
or
return
input_
and
os
.
path
.
isfile
(
input_
)
and
(
input_
.
endswith
(
'.job'
)
or
input_
.
endswith
(
'.txt'
))
input_
.
endswith
(
'.txt'
)
or
input_
.
endswith
(
'.scp'
))
def
_get_job_contents
(
def
_get_job_contents
(
self
,
job_input
:
os
.
PathLike
)
->
Dict
[
str
,
Union
[
str
,
os
.
PathLike
]]:
self
,
job_input
:
os
.
PathLike
)
->
Dict
[
str
,
Union
[
str
,
os
.
PathLike
]]:
...
@@ -189,7 +191,7 @@ class BaseExecutor(ABC):
...
@@ -189,7 +191,7 @@ class BaseExecutor(ABC):
line
=
line
.
strip
()
line
=
line
.
strip
()
if
not
line
:
if
not
line
:
continue
continue
k
,
v
=
line
.
split
(
' '
)
k
,
v
=
line
.
split
(
)
# space or \t
job_contents
[
k
]
=
v
job_contents
[
k
]
=
v
return
job_contents
return
job_contents
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录