Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
a773fe88
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看板
提交
a773fe88
编写于
5月 14, 2020
作者:
M
MRXLT
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix imdb reader
上级
88cbb37a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
11 addition
and
11 deletion
+11
-11
python/examples/imdb/benchmark.py
python/examples/imdb/benchmark.py
+1
-1
python/examples/imdb/test_client.py
python/examples/imdb/test_client.py
+2
-2
python/examples/imdb/test_ensemble_client.py
python/examples/imdb/test_ensemble_client.py
+1
-1
python/examples/imdb/text_classify_service.py
python/examples/imdb/text_classify_service.py
+2
-2
python/paddle_serving_app/__init__.py
python/paddle_serving_app/__init__.py
+1
-1
python/paddle_serving_app/reader/imdb_reader.py
python/paddle_serving_app/reader/imdb_reader.py
+2
-2
tools/serving_build.sh
tools/serving_build.sh
+2
-2
未找到文件。
python/examples/imdb/benchmark.py
浏览文件 @
a773fe88
...
...
@@ -16,7 +16,7 @@
import
sys
import
time
import
requests
from
imdb_reader
import
IMDBDataset
from
paddle_serving_app
import
IMDBDataset
from
paddle_serving_client
import
Client
from
paddle_serving_client.utils
import
MultiThreadRunner
from
paddle_serving_client.utils
import
benchmark_args
...
...
python/examples/imdb/test_client.py
浏览文件 @
a773fe88
...
...
@@ -13,7 +13,7 @@
# limitations under the License.
# pylint: disable=doc-string-missing
from
paddle_serving_client
import
Client
from
paddle_serving_app
import
IMDB
Reader
from
paddle_serving_app
import
IMDB
Dataset
import
sys
client
=
Client
()
...
...
@@ -23,7 +23,7 @@ client.connect(["127.0.0.1:9292"])
# you can define any english sentence or dataset here
# This example reuses imdb reader in training, you
# can define your own data preprocessing easily.
imdb_dataset
=
IMD
BReader
()
imdb_dataset
=
IMD
Dataset
()
imdb_dataset
.
load_resource
(
sys
.
argv
[
2
])
for
line
in
sys
.
stdin
:
...
...
python/examples/imdb/test_ensemble_client.py
浏览文件 @
a773fe88
...
...
@@ -14,7 +14,7 @@
# pylint: disable=doc-string-missing
from
paddle_serving_client
import
Client
from
imdb_reader
import
IMDBDataset
from
paddle_serving_app
import
IMDBDataset
client
=
Client
()
# If you have more than one model, make sure that the input
...
...
python/examples/imdb/text_classify_service.py
浏览文件 @
a773fe88
...
...
@@ -14,7 +14,7 @@
# pylint: disable=doc-string-missing
from
paddle_serving_server.web_service
import
WebService
from
paddle_serving_app
import
IMDB
Reader
from
paddle_serving_app
import
IMDB
Dataset
import
sys
...
...
@@ -22,7 +22,7 @@ class IMDBService(WebService):
def
prepare_dict
(
self
,
args
=
{}):
if
len
(
args
)
==
0
:
exit
(
-
1
)
self
.
dataset
=
IMDB
Reader
()
self
.
dataset
=
IMDB
Dataset
()
self
.
dataset
.
load_resource
(
args
[
"dict_file_path"
])
def
preprocess
(
self
,
feed
=
{},
fetch
=
[]):
...
...
python/paddle_serving_app/__init__.py
浏览文件 @
a773fe88
...
...
@@ -15,6 +15,6 @@ from .reader.chinese_bert_reader import ChineseBertReader
from
.reader.image_reader
import
ImageReader
,
File2Image
,
URL2Image
,
Sequential
,
Normalize
,
CenterCrop
,
Resize
from
.reader.lac_reader
import
LACReader
from
.reader.senta_reader
import
SentaReader
from
.reader.imdb_reader
import
IMDB
Reader
from
.reader.imdb_reader
import
IMDB
Dataset
from
.models
import
ServingModels
from
.local_predict
import
Debugger
python/paddle_serving_app/reader/imdb_reader.py
浏览文件 @
a773fe88
...
...
@@ -22,7 +22,7 @@ import paddle.fluid.incubate.data_generator as dg
py_version
=
sys
.
version_info
[
0
]
class
IMDB
Reader
(
dg
.
MultiSlotDataGenerator
):
class
IMDB
Dataset
(
dg
.
MultiSlotDataGenerator
):
def
load_resource
(
self
,
dictfile
):
self
.
_vocab
=
{}
wid
=
0
...
...
@@ -87,6 +87,6 @@ class IMDBReader(dg.MultiSlotDataGenerator):
if
__name__
==
"__main__"
:
imdb
=
IMDB
Reader
()
imdb
=
IMDB
Dataset
()
imdb
.
load_resource
(
"imdb.vocab"
)
imdb
.
run_from_stdin
()
tools/serving_build.sh
浏览文件 @
a773fe88
...
...
@@ -343,7 +343,7 @@ function python_test_imdb() {
sleep
5
check_cmd
"head test_data/part-0 | python test_client.py imdb_cnn_client_conf/serving_client_conf.prototxt imdb.vocab"
# test batch predict
check_cmd
"python benchmark
_batch
.py --thread 4 --batch_size 8 --model imdb_bow_client_conf/serving_client_conf.prototxt --request rpc --endpoint 127.0.0.1:9292"
check_cmd
"python benchmark.py --thread 4 --batch_size 8 --model imdb_bow_client_conf/serving_client_conf.prototxt --request rpc --endpoint 127.0.0.1:9292"
echo
"imdb CPU RPC inference pass"
kill_server_process
rm
-rf
work_dir1
...
...
@@ -359,7 +359,7 @@ function python_test_imdb() {
exit
1
fi
# test batch predict
check_cmd
"python benchmark
_batch
.py --thread 4 --batch_size 8 --model imdb_bow_client_conf/serving_client_conf.prototxt --request http --endpoint 127.0.0.1:9292"
check_cmd
"python benchmark.py --thread 4 --batch_size 8 --model imdb_bow_client_conf/serving_client_conf.prototxt --request http --endpoint 127.0.0.1:9292"
setproxy
# recover proxy state
kill_server_process
ps
-ef
|
grep
"text_classify_service.py"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录