Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
10da21a7
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 1 年 前同步成功
通知
207
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,发现更多精彩内容 >>
提交
10da21a7
编写于
5月 02, 2022
作者:
X
xiongxinlei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update the vector cli for server, test=doc
上级
3950557e
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
12 addition
and
5 deletion
+12
-5
demos/streaming_asr_server/websocket_client.py
demos/streaming_asr_server/websocket_client.py
+1
-1
paddlespeech/cli/vector/infer.py
paddlespeech/cli/vector/infer.py
+3
-0
paddlespeech/server/bin/paddlespeech_client.py
paddlespeech/server/bin/paddlespeech_client.py
+5
-1
paddlespeech/server/engine/vector/python/vector_engine.py
paddlespeech/server/engine/vector/python/vector_engine.py
+2
-2
paddlespeech/server/restful/request.py
paddlespeech/server/restful/request.py
+1
-1
未找到文件。
demos/streaming_asr_server/websocket_client.py
浏览文件 @
10da21a7
...
...
@@ -37,7 +37,7 @@ def main(args):
if
args
.
wavfile
and
os
.
path
.
exists
(
args
.
wavfile
):
logger
.
info
(
f
"start to process the wavscp:
{
args
.
wavfile
}
"
)
result
=
loop
.
run_until_complete
(
handler
.
run
(
args
.
wavfile
))
#
result = result["result"]
result
=
result
[
"result"
]
logger
.
info
(
f
"asr websocket client finished :
{
result
}
"
)
# support to process batch audios from wav.scp
...
...
paddlespeech/cli/vector/infer.py
浏览文件 @
10da21a7
...
...
@@ -285,8 +285,10 @@ class VectorExecutor(BaseExecutor):
Defaults to None.
ckpt_path (Optional[os.PathLike], optional): the pretrained model path, which is stored in the disk.
Defaults to None.
task (str, optional): the model task type
"""
# stage 0: avoid to init the mode again
self
.
task
=
task
if
hasattr
(
self
,
"model"
):
logger
.
info
(
"Model has been initialized"
)
return
...
...
@@ -435,6 +437,7 @@ class VectorExecutor(BaseExecutor):
if
self
.
sample_rate
!=
16000
and
self
.
sample_rate
!=
8000
:
logger
.
error
(
"invalid sample rate, please input --sr 8000 or --sr 16000"
)
logger
.
error
(
f
"The model sample rate:
{
self
.
sample_rate
}
, the external sample rate is:
{
sample_rate
}
"
)
return
False
if
isinstance
(
audio_file
,
(
str
,
os
.
PathLike
)):
...
...
paddlespeech/server/bin/paddlespeech_client.py
浏览文件 @
10da21a7
...
...
@@ -602,7 +602,11 @@ class VectorClientExecutor(BaseExecutor):
default
=
None
,
help
=
'sentence to be process by text server.'
)
self
.
parser
.
add_argument
(
'--task'
,
type
=
str
,
default
=
"spk"
,
help
=
"The vector service task"
)
'--task'
,
type
=
str
,
default
=
"spk"
,
choices
=
[
"spk"
,
"score"
],
help
=
"The vector service task"
)
self
.
parser
.
add_argument
(
"--enroll"
,
type
=
str
,
default
=
None
,
help
=
"The enroll audio"
)
self
.
parser
.
add_argument
(
...
...
paddlespeech/server/engine/vector/python/vector_engine.py
浏览文件 @
10da21a7
...
...
@@ -99,8 +99,8 @@ class PaddleVectorConnectionHandler:
"""extract the audio embedding
Args:
audio (
_type_): _description_
sample_rate (int, optional):
_description_
. Defaults to 16000.
audio (
str): the audio data
sample_rate (int, optional):
the audio sample rate
. Defaults to 16000.
"""
# we can not reuse the cache io.BytesIO(audio) data,
# because the soundfile will change the io.BytesIO(audio) to the end
...
...
paddlespeech/server/restful/request.py
浏览文件 @
10da21a7
...
...
@@ -115,7 +115,7 @@ class VectorScoreRequest(BaseModel):
{
"enroll_audio": "exSI6ICJlbiIsCgkgICAgInBvc2l0aW9uIjogImZhbHNlIgoJf...",
"test_audio": "exSI6ICJlbiIsCgkgICAgInBvc2l0aW9uIjogImZhbHNlIgoJf...",
"task": "s
pk
",
"task": "s
core
",
"audio_format": "wav",
"sample_rate": 16000,
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录