Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
89bc3ba4
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,发现更多精彩内容 >>
提交
89bc3ba4
编写于
3月 09, 2022
作者:
L
lym0302
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify tests, test=doc
上级
0a6602c7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
34 addition
and
17 deletion
+34
-17
tests/unit/server/change_yaml.py
tests/unit/server/change_yaml.py
+9
-1
tests/unit/server/test_server_client.sh
tests/unit/server/test_server_client.sh
+25
-16
未找到文件。
tests/unit/server/change_yaml.py
浏览文件 @
89bc3ba4
...
...
@@ -25,13 +25,15 @@ def change_device(yamlfile: str, engine: str, device: str):
with
open
(
tmp_yamlfile
)
as
f
,
open
(
yamlfile
,
"w+"
,
encoding
=
"utf-8"
)
as
fw
:
y
=
yaml
.
safe_load
(
f
)
if
engine
==
'asr_python'
or
engine
==
'tts_python'
:
if
engine
==
'asr_python'
or
engine
==
'tts_python'
or
engine
==
'cls_python'
:
y
[
engine
][
'device'
]
=
set_device
elif
engine
==
'asr_inference'
:
y
[
engine
][
'am_predictor_conf'
][
'device'
]
=
set_device
elif
engine
==
'tts_inference'
:
y
[
engine
][
'am_predictor_conf'
][
'device'
]
=
set_device
y
[
engine
][
'voc_predictor_conf'
][
'device'
]
=
set_device
elif
engine
==
'cls_inference'
:
y
[
engine
][
'predictor_conf'
][
'device'
]
=
set_device
else
:
print
(
"Please set correct engine: asr_python, tts_python, asr_inference, tts_inference."
...
...
@@ -84,6 +86,8 @@ if __name__ == "__main__":
'enginetype-asr_inference'
,
'enginetype-tts_python'
,
'enginetype-tts_inference'
,
'enginetype-cls_python'
,
'enginetype-cls_inference'
,
'device-asr_python-cpu'
,
'device-asr_python-gpu'
,
'device-asr_inference-cpu'
,
...
...
@@ -92,6 +96,10 @@ if __name__ == "__main__":
'device-tts_python-gpu'
,
'device-tts_inference-cpu'
,
'device-tts_inference-gpu'
,
'device-cls_python-cpu'
,
'device-cls_python-gpu'
,
'device-cls_inference-cpu'
,
'device-cls_inference-gpu'
,
],
required
=
True
)
args
=
parser
.
parse_args
()
...
...
tests/unit/server/test_server_client.sh
浏览文件 @
89bc3ba4
...
...
@@ -33,15 +33,21 @@ ClientTest(){
((
test_times+
=
1
))
paddlespeech_client tts
--server_ip
$server_ip
--port
$port
--input
"您好,欢迎使用百度飞桨语音合成服务。"
--output
output.wav
((
test_times+
=
1
))
# test cls client
paddlespeech_client cls
--server_ip
$server_ip
--port
$port
--input
./zh.wav
((
test_times+
=
1
))
paddlespeech_client cls
--server_ip
$server_ip
--port
$port
--input
./zh.wav
((
test_times+
=
1
))
}
GetTestResult
()
{
# Determine if the test was successful
response_success_time
=
$(
cat
log/server.log |
grep
"200 OK"
-c
)
if
((
$response_success_time
==
$test_times
))
;
then
echo
"Testing successfully. The service configuration is: asr engine type:
$1
; tts engine type:
$1
; device:
$2
."
|
tee
-a
./log/test_result.log
echo
"Testing successfully. The service configuration is: asr engine type:
$1
; tts engine type:
$1
;
cls engine type:
$1
;
device:
$2
."
|
tee
-a
./log/test_result.log
else
echo
"Testing failed. The service configuration is: asr engine type:
$1
; tts engine type:
$1
; device:
$2
."
|
tee
-a
./log/test_result.log
echo
"Testing failed. The service configuration is: asr engine type:
$1
; tts engine type:
$1
;
cls engine type:
$1
;
device:
$2
."
|
tee
-a
./log/test_result.log
fi
test_times
=
$response_success_time
}
...
...
@@ -74,8 +80,8 @@ target_start_num=0 # the number of start service
test_times
=
0
# The number of client test
error_time
=
0
# The number of error occurrences in the startup failure server.log.wf file
# start server: asr engine type: python; tts engine type: python; device: gpu
echo
"Start the service: asr engine type: python; tts engine type: python; device: gpu"
|
tee
-a
./log/test_result.log
# start server: asr engine type: python; tts engine type: python;
cls engine type: python;
device: gpu
echo
"Start the service: asr engine type: python; tts engine type: python;
cls engine type: python;
device: gpu"
|
tee
-a
./log/test_result.log
((
target_start_num+
=
1
))
StartService
...
...
@@ -98,11 +104,12 @@ echo "**************************************************************************
# start server: asr engine type: python; tts engine type: python; device: cpu
python change_yaml.py
--change_task
device-asr_python-cpu
# change asr.yaml device: cpu
python change_yaml.py
--change_task
device-tts_python-cpu
# change tts.yaml device: cpu
# start server: asr engine type: python; tts engine type: python; cls engine type: python; device: cpu
python change_yaml.py
--change_task
device-asr_python-cpu
# change asr_python device: cpu
python change_yaml.py
--change_task
device-tts_python-cpu
# change tts_python device: cpu
python change_yaml.py
--change_task
device-cls_python-cpu
# change cls_python device: cpu
echo
"Start the service: asr engine type: python; tts engine type: python; device: cpu"
|
tee
-a
./log/test_result.log
echo
"Start the service: asr engine type: python; tts engine type: python;
cls engine type: python;
device: cpu"
|
tee
-a
./log/test_result.log
((
target_start_num+
=
1
))
StartService
...
...
@@ -124,11 +131,12 @@ sleep 2s
echo
"**************************************************************************************"
|
tee
-a
./log/test_result.log
# start server: asr engine type: inference; tts engine type: inference; device: gpu
python change_yaml.py
--change_task
enginetype-asr_inference
# change application.yaml, asr engine_type: inference; asr engine_backend: asr_pd.yaml
python change_yaml.py
--change_task
enginetype-tts_inference
# change application.yaml, tts engine_type: inference; tts engine_backend: tts_pd.yaml
# start server: asr engine type: inference; tts engine type: inference; cls engine type: inference; device: gpu
python change_yaml.py
--change_task
enginetype-asr_inference
# change engine_list: 'asr_python' -> 'asr_inference'
python change_yaml.py
--change_task
enginetype-tts_inference
# change engine_list: 'tts_python' -> 'tts_inference'
python change_yaml.py
--change_task
enginetype-cls_inference
# change engine_list: 'cls_python' -> 'cls_inference'
echo
"Start the service: asr engine type: inference; tts engine type: inference; device: gpu"
|
tee
-a
./log/test_result.log
echo
"Start the service: asr engine type: inference; tts engine type: inference;
cls engine type: inference;
device: gpu"
|
tee
-a
./log/test_result.log
((
target_start_num+
=
1
))
StartService
...
...
@@ -150,11 +158,12 @@ sleep 2s
echo
"**************************************************************************************"
|
tee
-a
./log/test_result.log
# start server: asr engine type: inference; tts engine type: inference; device: cpu
python change_yaml.py
--change_task
device-asr_inference-cpu
# change asr_pd.yaml device: cpu
python change_yaml.py
--change_task
device-tts_inference-cpu
# change tts_pd.yaml device: cpu
# start server: asr engine type: inference; tts engine type: inference; cls engine type: inference; device: cpu
python change_yaml.py
--change_task
device-asr_inference-cpu
# change asr_inference device: cpu
python change_yaml.py
--change_task
device-tts_inference-cpu
# change tts_inference device: cpu
python change_yaml.py
--change_task
device-cls_inference-cpu
# change cls_inference device: cpu
echo
"start the service: asr engine type: inference; tts engine type: inference; device: cpu"
|
tee
-a
./log/test_result.log
echo
"start the service: asr engine type: inference; tts engine type: inference;
cls engine type: inference;
device: cpu"
|
tee
-a
./log/test_result.log
((
target_start_num+
=
1
))
StartService
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录