Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
38dc5701
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看板
提交
38dc5701
编写于
12月 22, 2020
作者:
W
wangjiawei04
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix doc
上级
68369110
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
20 deletion
+21
-20
README.md
README.md
+2
-10
README_CN.md
README_CN.md
+1
-1
doc/BERT_10_MINS.md
doc/BERT_10_MINS.md
+9
-5
doc/BERT_10_MINS_CN.md
doc/BERT_10_MINS_CN.md
+9
-4
未找到文件。
README.md
浏览文件 @
38dc5701
...
@@ -66,15 +66,6 @@ For **Windows Users**, please read the document [Paddle Serving for Windows User
...
@@ -66,15 +66,6 @@ For **Windows Users**, please read the document [Paddle Serving for Windows User
<h2
align=
"center"
>
Pre-built services with Paddle Serving
</h2>
<h2
align=
"center"
>
Pre-built services with Paddle Serving
</h2>
<h3
align=
"center"
>
Latest release
</h4>
<p
align=
"center"
>
<a
href=
"https://github.com/PaddlePaddle/Serving/tree/develop/python/examples/ocr"
>
Optical Character Recognition
</a>
<br>
<a
href=
"https://github.com/PaddlePaddle/Serving/tree/develop/python/examples/faster_rcnn_model"
>
Object Detection
</a>
<br>
<a
href=
"https://github.com/PaddlePaddle/Serving/tree/develop/python/examples/deeplabv3"
>
Image Segmentation
</a>
<p>
<h3
align=
"center"
>
Chinese Word Segmentation
</h4>
<h3
align=
"center"
>
Chinese Word Segmentation
</h4>
```
shell
```
shell
...
@@ -133,7 +124,8 @@ python -m paddle_serving_server.serve --model uci_housing_model --thread 10 --po
...
@@ -133,7 +124,8 @@ python -m paddle_serving_server.serve --model uci_housing_model --thread 10 --po
|
`use_trt`
(Only for trt version) | - | - | Run inference with TensorRT |
|
`use_trt`
(Only for trt version) | - | - | Run inference with TensorRT |
</center>
</center>
```
python
```
python
# A user can visit rpc service through paddle_serving_client API
# A user can visit rpc service through paddle_serving_client API
from
paddle_serving_client
import
Client
from
paddle_serving_client
import
Client
import
numpy
as
np
import
numpy
as
np
...
...
README_CN.md
浏览文件 @
38dc5701
...
@@ -148,7 +148,7 @@ print(fetch_map)
...
@@ -148,7 +148,7 @@ print(fetch_map)
在这里,
`client.predict`
函数具有两个参数。
`feed`
是带有模型输入变量别名和值的
`python dict`
。
`fetch`
被要从服务器返回的预测变量赋值。 在该示例中,在训练过程中保存可服务模型时,被赋值的tensor名为
`"x"`
和
`"price"`
。
在这里,
`client.predict`
函数具有两个参数。
`feed`
是带有模型输入变量别名和值的
`python dict`
。
`fetch`
被要从服务器返回的预测变量赋值。 在该示例中,在训练过程中保存可服务模型时,被赋值的tensor名为
`"x"`
和
`"price"`
。
<h3
align=
"center"
>
HTTP服务
</h3>
<h3
align=
"center"
>
HTTP服务
</h3>
用户也可以将数据格式处理逻辑放在服务器端进行,这样就可以直接用curl去访问服务,参考如下案例,在目录
`
`python/examples/fit_a_line`
`
用户也可以将数据格式处理逻辑放在服务器端进行,这样就可以直接用curl去访问服务,参考如下案例,在目录
`
python/examples/fit_a_line
`
```
python
```
python
from
paddle_serving_server.web_service
import
WebService
from
paddle_serving_server.web_service
import
WebService
...
...
doc/BERT_10_MINS.md
浏览文件 @
38dc5701
...
@@ -56,21 +56,25 @@ the script of client side bert_client.py is as follow:
...
@@ -56,21 +56,25 @@ the script of client side bert_client.py is as follow:
[
//file
]:
#bert_client.py
[
//file
]:
#bert_client.py
```
python
```
python
import
os
import
sys
import
sys
from
paddle_serving_client
import
Client
from
paddle_serving_client
import
Client
from
paddle_serving_client.utils
import
benchmark_args
from
paddle_serving_app.reader
import
ChineseBertReader
from
paddle_serving_app.reader
import
ChineseBertReader
import
numpy
as
np
args
=
benchmark_args
()
reader
=
ChineseBertReader
()
reader
=
ChineseBertReader
(
{
"max_seq_len"
:
128
}
)
fetch
=
[
"pooled_output"
]
fetch
=
[
"pooled_output"
]
endpoint_list
=
[
"127.0.0.1:9292"
]
endpoint_list
=
[
'127.0.0.1:9292'
]
client
=
Client
()
client
=
Client
()
client
.
load_client_config
(
"bert_seq20_client/serving_client_conf.prototxt"
)
client
.
load_client_config
(
args
.
model
)
client
.
connect
(
endpoint_list
)
client
.
connect
(
endpoint_list
)
for
line
in
sys
.
stdin
:
for
line
in
sys
.
stdin
:
feed_dict
=
reader
.
process
(
line
)
feed_dict
=
reader
.
process
(
line
)
result
=
client
.
predict
(
feed
=
feed_dict
,
fetch
=
fetch
)
for
key
in
feed_dict
.
keys
():
feed_dict
[
key
]
=
np
.
array
(
feed_dict
[
key
]).
reshape
((
128
,
1
))
result
=
client
.
predict
(
feed
=
feed_dict
,
fetch
=
fetch
,
batch
=
False
)
```
```
run
run
...
...
doc/BERT_10_MINS_CN.md
浏览文件 @
38dc5701
...
@@ -52,18 +52,23 @@ pip install paddle_serving_app
...
@@ -52,18 +52,23 @@ pip install paddle_serving_app
```
python
```
python
import
sys
import
sys
from
paddle_serving_client
import
Client
from
paddle_serving_client
import
Client
from
paddle_serving_client.utils
import
benchmark_args
from
paddle_serving_app.reader
import
ChineseBertReader
from
paddle_serving_app.reader
import
ChineseBertReader
import
numpy
as
np
args
=
benchmark_args
()
reader
=
ChineseBertReader
()
reader
=
ChineseBertReader
(
{
"max_seq_len"
:
128
}
)
fetch
=
[
"pooled_output"
]
fetch
=
[
"pooled_output"
]
endpoint_list
=
[
"127.0.0.1:9292"
]
endpoint_list
=
[
'127.0.0.1:9292'
]
client
=
Client
()
client
=
Client
()
client
.
load_client_config
(
"bert_seq20_client/serving_client_conf.prototxt"
)
client
.
load_client_config
(
args
.
model
)
client
.
connect
(
endpoint_list
)
client
.
connect
(
endpoint_list
)
for
line
in
sys
.
stdin
:
for
line
in
sys
.
stdin
:
feed_dict
=
reader
.
process
(
line
)
feed_dict
=
reader
.
process
(
line
)
result
=
client
.
predict
(
feed
=
feed_dict
,
fetch
=
fetch
)
for
key
in
feed_dict
.
keys
():
feed_dict
[
key
]
=
np
.
array
(
feed_dict
[
key
]).
reshape
((
128
,
1
))
result
=
client
.
predict
(
feed
=
feed_dict
,
fetch
=
fetch
,
batch
=
False
)
```
```
执行
执行
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录