Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
261f128c
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看板
提交
261f128c
编写于
6月 04, 2020
作者:
M
MRXLT
提交者:
GitHub
6月 04, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #647 from MRXLT/0.3.0-cherry
[cherry pick to 0.3.0]
上级
8ef2e195
4128c869
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
16 addition
and
9 deletion
+16
-9
python/examples/lac/lac_client.py
python/examples/lac/lac_client.py
+1
-2
python/examples/senta/README.md
python/examples/senta/README.md
+3
-1
python/examples/senta/README_CN.md
python/examples/senta/README_CN.md
+3
-1
python/paddle_serving_app/models/model_list.py
python/paddle_serving_app/models/model_list.py
+1
-1
python/paddle_serving_app/reader/lac_reader.py
python/paddle_serving_app/reader/lac_reader.py
+4
-0
python/paddle_serving_server/monitor.py
python/paddle_serving_server/monitor.py
+2
-2
python/paddle_serving_server_gpu/monitor.py
python/paddle_serving_server_gpu/monitor.py
+2
-2
未找到文件。
python/examples/lac/lac_client.py
浏览文件 @
261f128c
...
...
@@ -35,5 +35,4 @@ for line in sys.stdin:
begin
=
fetch_map
[
'crf_decode.lod'
][
0
]
end
=
fetch_map
[
'crf_decode.lod'
][
1
]
segs
=
reader
.
parse_result
(
line
,
fetch_map
[
"crf_decode"
][
begin
:
end
])
print
({
"word_seg"
:
"|"
.
join
(
segs
)})
print
(
"word_seg: "
+
"|"
.
join
(
str
(
words
)
for
words
in
segs
))
python/examples/senta/README.md
浏览文件 @
261f128c
...
...
@@ -5,6 +5,8 @@
```
python -m paddle_serving_app.package --get_model senta_bilstm
python -m paddle_serving_app.package --get_model lac
tar -xzvf senta_bilstm.tar.gz
tar -xzvf lac.tar.gz
```
## Start HTTP Service
...
...
@@ -17,5 +19,5 @@ In this demo, the LAC task is placed in the preprocessing part of the HTTP predi
## Client prediction
```
curl -H "Content-Type:application/json" -X POST -d '{"feed":[{"words": "天气不错"}], "fetch":["class_probs"]}' http://127.0.0.1:9
292
/senta/prediction
curl -H "Content-Type:application/json" -X POST -d '{"feed":[{"words": "天气不错"}], "fetch":["class_probs"]}' http://127.0.0.1:9
393
/senta/prediction
```
python/examples/senta/README_CN.md
浏览文件 @
261f128c
...
...
@@ -5,6 +5,8 @@
```
python -m paddle_serving_app.package --get_model senta_bilstm
python -m paddle_serving_app.package --get_model lac
tar -xzvf lac.tar.gz
tar -xzvf senta_bilstm.tar.gz
```
## 启动HTTP服务
...
...
@@ -17,5 +19,5 @@ python senta_web_service.py
## 客户端预测
```
curl -H "Content-Type:application/json" -X POST -d '{"feed":[{"words": "天气不错"}], "fetch":["class_probs"]}' http://127.0.0.1:9
292
/senta/prediction
curl -H "Content-Type:application/json" -X POST -d '{"feed":[{"words": "天气不错"}], "fetch":["class_probs"]}' http://127.0.0.1:9
393
/senta/prediction
```
python/paddle_serving_app/models/model_list.py
浏览文件 @
261f128c
...
...
@@ -38,7 +38,7 @@ class ServingModels(object):
object_detection_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/image/ObjectDetection/"
ocr_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/image/OCR/"
senta_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/SentimentAnalysis/"
semantic_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/Semantic
Representation
/"
semantic_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/Semantic
Model
/"
wordseg_url
=
"https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/LexicalAnalysis/"
self
.
url_dict
=
{}
...
...
python/paddle_serving_app/reader/lac_reader.py
浏览文件 @
261f128c
...
...
@@ -111,6 +111,10 @@ class LACReader(object):
return
word_ids
def
parse_result
(
self
,
words
,
crf_decode
):
try
:
words
=
unicode
(
words
,
"utf-8"
)
except
:
pass
tags
=
[
self
.
id2label_dict
[
str
(
x
[
0
])]
for
x
in
crf_decode
]
sent_out
=
[]
...
...
python/paddle_serving_server/monitor.py
浏览文件 @
261f128c
...
...
@@ -20,7 +20,7 @@ Usage:
import
os
import
time
import
argparse
import
command
s
import
subproces
s
import
datetime
import
shutil
import
tarfile
...
...
@@ -209,7 +209,7 @@ class HadoopMonitor(Monitor):
remote_filepath
=
os
.
path
.
join
(
path
,
filename
)
cmd
=
'{} -ls {} 2>/dev/null'
.
format
(
self
.
_cmd_prefix
,
remote_filepath
)
_LOGGER
.
debug
(
'check cmd: {}'
.
format
(
cmd
))
[
status
,
output
]
=
command
s
.
getstatusoutput
(
cmd
)
[
status
,
output
]
=
subproces
s
.
getstatusoutput
(
cmd
)
_LOGGER
.
debug
(
'resp: {}'
.
format
(
output
))
if
status
==
0
:
[
_
,
_
,
_
,
_
,
_
,
mdate
,
mtime
,
_
]
=
output
.
split
(
'
\n
'
)[
-
1
].
split
()
...
...
python/paddle_serving_server_gpu/monitor.py
浏览文件 @
261f128c
...
...
@@ -20,7 +20,7 @@ Usage:
import
os
import
time
import
argparse
import
command
s
import
subproces
s
import
datetime
import
shutil
import
tarfile
...
...
@@ -209,7 +209,7 @@ class HadoopMonitor(Monitor):
remote_filepath
=
os
.
path
.
join
(
path
,
filename
)
cmd
=
'{} -ls {} 2>/dev/null'
.
format
(
self
.
_cmd_prefix
,
remote_filepath
)
_LOGGER
.
debug
(
'check cmd: {}'
.
format
(
cmd
))
[
status
,
output
]
=
command
s
.
getstatusoutput
(
cmd
)
[
status
,
output
]
=
subproces
s
.
getstatusoutput
(
cmd
)
_LOGGER
.
debug
(
'resp: {}'
.
format
(
output
))
if
status
==
0
:
[
_
,
_
,
_
,
_
,
_
,
mdate
,
mtime
,
_
]
=
output
.
split
(
'
\n
'
)[
-
1
].
split
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录