Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
1e6e135c
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1e6e135c
编写于
4月 02, 2020
作者:
W
wangjiawei04
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add example to ci test test=serving
上级
6b7d01ec
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
50 addition
and
9 deletion
+50
-9
tools/serving_build.sh
tools/serving_build.sh
+50
-9
未找到文件。
tools/serving_build.sh
浏览文件 @
1e6e135c
...
...
@@ -265,13 +265,15 @@ function python_run_criteo_ctr_with_cube() {
function
python_test_bert
()
{
# pwd: /Serving/python/examples
local
TYPE
=
$1
export
SERVING_BIN
=
${
SERVING_WORKDIR
}
/build-server-
${
TYPE
}
/core/general-server/serving
cd
bert
# pwd: /Serving/python/examples/bert
case
$TYPE
in
CPU
)
pip
install
paddlehub
python prepare_model.py 20
sh get_data.sh
python
-m
paddle_serving_server.serve
--model
bert_seq20_model/
--port
9292 &
check_cmd
"python -m paddle_serving_server.serve --model bert_seq20_model/ --port 9292 &"
sleep
5
pip
install
paddle_serving_app
check_cmd
"head -n 10 data-c.txt | python bert_client.py --model bert_seq20_client/serving_client_conf.prototxt"
ps
-ef
|
grep
"paddle_serving_server"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
...
...
@@ -281,7 +283,8 @@ function python_test_bert() {
pip
install
paddlehub
python prepare_model.py 20
sh get_data.sh
python
-m
paddle_serving_server_gpu.serve
--model
bert_seq20_model/
--port
9292
--gpu_ids
0 &
check_cmd
"python -m paddle_serving_server_gpu.serve --model bert_seq20_model/ --port 9292 --gpu_ids 0 &"
sleep
5
pip
install
paddle_serving_app
check_cmd
"head -n 10 data-c.txt | python bert_client.py --model bert_seq20_client/serving_client_conf.prototxt"
ps
-ef
|
grep
"paddle_serving_server"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
...
...
@@ -290,24 +293,29 @@ function python_test_bert() {
*
)
esac
echo
"test bert
$TYPE
finished as expected."
unset
SERVING_BIN
cd
..
}
function
python_test_imdb
()
{
# pwd: /Serving/python/examples
local
TYPE
=
$1
cd
imdb
# pwd: /Serving/python/examples/bert
export
SERVING_BIN
=
${
SERVING_WORKDIR
}
/build-server-
${
TYPE
}
/core/general-server/serving
cd
imdb
# pwd: /Serving/python/examples/imdb
case
$TYPE
in
CPU
)
sh get_data.sh
python
-m
paddle_serving_server.serve
--model
imdb_cnn_model/
--port
9292 &
check_cmd
"python -m paddle_serving_server.serve --model imdb_cnn_model/ --port 9292 &"
sleep
5
check_cmd
"head test_data/part-0 | python test_client.py imdb_cnn_client_conf/serving_client_conf.prototxt imdb.vocab"
echo
"imdb CPU RPC inference pass"
ps
-ef
|
grep
"paddle_serving_server"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
python text_classify_service.py imdb_cnn_model/ workdir/ 9292 imdb.vocab &
check_cmd
"python text_classify_service.py imdb_cnn_model/ workdir/ 9292 imdb.vocab &"
sleep
5
check_cmd
"curl -H "
Content-Type:application/json
" -X POST -d '{"
words
": "
i am very sad | 0
", "
fetch
":["
prediction
"]}' http://127.0.0.1:9292/imdb/prediction"
ps
-ef
|
grep
"paddle_serving_server"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
ps
-ef
|
grep
"text_classify_service.py"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
echo
"imdb CPU HTTP inference pass"
;;
GPU
)
...
...
@@ -316,6 +324,38 @@ function python_test_imdb() {
*
)
esac
echo
"test imdb
$TYPE
finished as expected."
unset
SERVING_BIN
cd
..
}
function
python_test_lac
()
{
# pwd: /Serving/python/examples
local
TYPE
=
$1
export
SERVING_BIN
=
${
SERVING_WORKDIR
}
/build-server-
${
TYPE
}
/core/general-server/serving
cd
lac
# pwd: /Serving/python/examples/lac
case
$TYPE
in
CPU
)
sh get_data.sh
check_cmd
"python -m paddle_serving_server.serve --model jieba_server_model/ --port 9292 &"
sleep
5
check_cmd
"echo "
我爱北京天安门
" | python lac_client.py jieba_client_conf/serving_client_conf.prototxt lac_dict/"
echo
"lac CPU RPC inference pass"
ps
-ef
|
grep
"paddle_serving_server"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
check_cmd
"python lac_web_service.py jieba_server_model/ lac_workdir 9292 &"
sleep
5
check_cmd
"curl -H "
Content-Type:application/json
" -X POST -d '{"
words
": "
我爱北京天安门
", "
fetch
":["
word_seg
"]}' http://127.0.0.1:9292/lac/prediction"
ps
-ef
|
grep
"paddle_serving_server"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
ps
-ef
|
grep
"lac_web_service"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
echo
"lac CPU HTTP inference pass"
;;
GPU
)
echo
"lac ignore GPU test"
;;
*
)
esac
echo
"test lac
$TYPE
finished as expected."
unset
SERVING_BIN
cd
..
}
...
...
@@ -326,7 +366,8 @@ function python_run_test() {
python_test_fit_a_line
$TYPE
# pwd: /Serving/python/examples
python_run_criteo_ctr_with_cube
$TYPE
# pwd: /Serving/python/examples
python_test_bert
$TYPE
# pwd: /Serving/python/examples
python_test_imdb
$TYPE
python_test_lac
$TYPE
echo
"test python
$TYPE
part finished as expected."
cd
../..
# pwd: /Serving
}
...
...
@@ -334,9 +375,9 @@ function python_run_test() {
function
main
()
{
local
TYPE
=
$1
# pwd: /
init
# pwd: /Serving
#
build_client $TYPE # pwd: /Serving
#
build_server $TYPE # pwd: /Serving
#
build_app $TYPE # pwd: /Serving
build_client
$TYPE
# pwd: /Serving
build_server
$TYPE
# pwd: /Serving
build_app
$TYPE
# pwd: /Serving
python_run_test
$TYPE
# pwd: /Serving
echo
"serving
$TYPE
part finished as expected."
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录