Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
6026f6c7
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
185
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6026f6c7
编写于
12月 04, 2020
作者:
J
Jiawei Wang
提交者:
wangjiawei04
12月 05, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge pull request #904 from wangjiawei04/thread_local_predictor
Threaded Flask for local predictor
上级
4aa92bc3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
8 deletion
+30
-8
python/paddle_serving_server/web_service.py
python/paddle_serving_server/web_service.py
+15
-4
python/paddle_serving_server_gpu/web_service.py
python/paddle_serving_server_gpu/web_service.py
+15
-4
未找到文件。
python/paddle_serving_server/web_service.py
浏览文件 @
6026f6c7
...
...
@@ -52,6 +52,20 @@ class WebService(object):
def
load_model_config
(
self
,
model_config
):
print
(
"This API will be deprecated later. Please do not use it"
)
self
.
model_config
=
model_config
import
os
from
.proto
import
general_model_config_pb2
as
m_config
import
google.protobuf.text_format
if
os
.
path
.
isdir
(
model_config
):
client_config
=
"{}/serving_server_conf.prototxt"
.
format
(
model_config
)
elif
os
.
path
.
isfile
(
path
):
client_config
=
model_config
model_conf
=
m_config
.
GeneralModelConfig
()
f
=
open
(
client_config
,
'r'
)
model_conf
=
google
.
protobuf
.
text_format
.
Merge
(
str
(
f
.
read
()),
model_conf
)
self
.
feed_names
=
[
var
.
alias_name
for
var
in
model_conf
.
feed_var
]
self
.
fetch_names
=
[
var
.
alias_name
for
var
in
model_conf
.
fetch_var
]
def
_launch_rpc_service
(
self
):
op_maker
=
OpMaker
()
...
...
@@ -179,10 +193,7 @@ class WebService(object):
def
run_web_service
(
self
):
print
(
"This API will be deprecated later. Please do not use it"
)
self
.
app_instance
.
run
(
host
=
"0.0.0.0"
,
port
=
self
.
port
,
threaded
=
False
,
processes
=
1
)
self
.
app_instance
.
run
(
host
=
"0.0.0.0"
,
port
=
self
.
port
,
threaded
=
True
)
def
get_app_instance
(
self
):
return
self
.
app_instance
...
...
python/paddle_serving_server_gpu/web_service.py
浏览文件 @
6026f6c7
...
...
@@ -58,6 +58,20 @@ class WebService(object):
def
load_model_config
(
self
,
model_config
):
print
(
"This API will be deprecated later. Please do not use it"
)
self
.
model_config
=
model_config
import
os
from
.proto
import
general_model_config_pb2
as
m_config
import
google.protobuf.text_format
if
os
.
path
.
isdir
(
model_config
):
client_config
=
"{}/serving_server_conf.prototxt"
.
format
(
model_config
)
elif
os
.
path
.
isfile
(
path
):
client_config
=
model_config
model_conf
=
m_config
.
GeneralModelConfig
()
f
=
open
(
client_config
,
'r'
)
model_conf
=
google
.
protobuf
.
text_format
.
Merge
(
str
(
f
.
read
()),
model_conf
)
self
.
feed_names
=
[
var
.
alias_name
for
var
in
model_conf
.
feed_var
]
self
.
fetch_names
=
[
var
.
alias_name
for
var
in
model_conf
.
fetch_var
]
def
set_gpus
(
self
,
gpus
):
print
(
"This API will be deprecated later. Please do not use it"
)
...
...
@@ -240,10 +254,7 @@ class WebService(object):
def
run_web_service
(
self
):
print
(
"This API will be deprecated later. Please do not use it"
)
self
.
app_instance
.
run
(
host
=
"0.0.0.0"
,
port
=
self
.
port
,
threaded
=
False
,
processes
=
4
)
self
.
app_instance
.
run
(
host
=
"0.0.0.0"
,
port
=
self
.
port
,
threaded
=
True
)
def
get_app_instance
(
self
):
return
self
.
app_instance
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录