Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
0e84c13d
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看板
提交
0e84c13d
编写于
8月 20, 2020
作者:
T
TeslaZhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bad code style by yapf
上级
e6263b1f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
46 addition
and
55 deletion
+46
-55
python/paddle_serving_server/serve.py
python/paddle_serving_server/serve.py
+46
-55
未找到文件。
python/paddle_serving_server/serve.py
浏览文件 @
0e84c13d
...
...
@@ -24,58 +24,50 @@ from flask import Flask, request
def
parse_args
():
# pylint: disable=doc-string-missing
parser
=
argparse
.
ArgumentParser
(
"serve"
)
parser
.
add_argument
(
"--thread"
,
type
=
int
,
default
=
10
,
help
=
"Concurrency of server"
)
parser
.
add_argument
(
"--model"
,
type
=
str
,
default
=
""
,
help
=
"Model for serving"
)
parser
.
add_argument
(
"--port"
,
type
=
int
,
default
=
9292
,
help
=
"Port the server"
)
parser
.
add_argument
(
"--name"
,
type
=
str
,
default
=
"None"
,
help
=
"Web service name"
)
parser
.
add_argument
(
"--workdir"
,
type
=
str
,
default
=
"workdir"
,
help
=
"Working dir of current service"
)
parser
.
add_argument
(
"--device"
,
type
=
str
,
default
=
"cpu"
,
help
=
"Type of device"
)
parser
.
add_argument
(
"--mem_optim_off"
,
default
=
False
,
action
=
"store_true"
,
help
=
"Memory optimize"
)
parser
.
add_argument
(
"--ir_optim"
,
default
=
False
,
action
=
"store_true"
,
help
=
"Graph optimize"
)
parser
.
add_argument
(
"--use_mkl"
,
default
=
False
,
action
=
"store_true"
,
help
=
"Use MKL"
)
parser
.
add_argument
(
"--max_body_size"
,
type
=
int
,
default
=
512
*
1024
*
1024
,
help
=
"Limit sizes of messages"
)
parser
.
add_argument
(
"--use_multilang"
,
default
=
False
,
action
=
"store_true"
,
help
=
"Use Multi-language-service"
)
parser
.
add_argument
(
"--product_name"
,
type
=
str
,
default
=
None
,
help
=
"product_name for authentication"
)
parser
.
add_argument
(
"--container_id"
,
type
=
str
,
default
=
None
,
help
=
"container_id for authentication"
)
parser
.
add_argument
(
"--thread"
,
type
=
int
,
default
=
10
,
help
=
"Concurrency of server"
)
parser
.
add_argument
(
"--model"
,
type
=
str
,
default
=
""
,
help
=
"Model for serving"
)
parser
.
add_argument
(
"--port"
,
type
=
int
,
default
=
9292
,
help
=
"Port the server"
)
parser
.
add_argument
(
"--name"
,
type
=
str
,
default
=
"None"
,
help
=
"Web service name"
)
parser
.
add_argument
(
"--workdir"
,
type
=
str
,
default
=
"workdir"
,
help
=
"Working dir of current service"
)
parser
.
add_argument
(
"--device"
,
type
=
str
,
default
=
"cpu"
,
help
=
"Type of device"
)
parser
.
add_argument
(
"--mem_optim_off"
,
default
=
False
,
action
=
"store_true"
,
help
=
"Memory optimize"
)
parser
.
add_argument
(
"--ir_optim"
,
default
=
False
,
action
=
"store_true"
,
help
=
"Graph optimize"
)
parser
.
add_argument
(
"--use_mkl"
,
default
=
False
,
action
=
"store_true"
,
help
=
"Use MKL"
)
parser
.
add_argument
(
"--max_body_size"
,
type
=
int
,
default
=
512
*
1024
*
1024
,
help
=
"Limit sizes of messages"
)
parser
.
add_argument
(
"--use_multilang"
,
default
=
False
,
action
=
"store_true"
,
help
=
"Use Multi-language-service"
)
parser
.
add_argument
(
"--product_name"
,
type
=
str
,
default
=
None
,
help
=
"product_name for authentication"
)
parser
.
add_argument
(
"--container_id"
,
type
=
str
,
default
=
None
,
help
=
"container_id for authentication"
)
return
parser
.
parse_args
()
...
...
@@ -137,9 +129,8 @@ if __name__ == "__main__":
else
:
service
=
WebService
(
name
=
args
.
name
)
service
.
load_model_config
(
args
.
model
)
service
.
prepare_server
(
workdir
=
args
.
workdir
,
port
=
args
.
port
,
device
=
args
.
device
)
service
.
prepare_server
(
workdir
=
args
.
workdir
,
port
=
args
.
port
,
device
=
args
.
device
)
service
.
run_rpc_service
()
app_instance
=
Flask
(
__name__
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录