Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
4969600f
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看板
提交
4969600f
编写于
3月 11, 2020
作者:
G
guru4elephant
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix web serve bug
上级
615f92f0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
4 deletion
+8
-4
python/paddle_serving_server_gpu/__init__.py
python/paddle_serving_server_gpu/__init__.py
+1
-0
python/paddle_serving_server_gpu/web_serve.py
python/paddle_serving_server_gpu/web_serve.py
+6
-3
python/paddle_serving_server_gpu/web_service.py
python/paddle_serving_server_gpu/web_service.py
+1
-1
未找到文件。
python/paddle_serving_server_gpu/__init__.py
浏览文件 @
4969600f
...
@@ -22,6 +22,7 @@ import socket
...
@@ -22,6 +22,7 @@ import socket
import
paddle_serving_server_gpu
as
paddle_serving_server
import
paddle_serving_server_gpu
as
paddle_serving_server
from
version
import
serving_server_version
from
version
import
serving_server_version
from
contextlib
import
closing
from
contextlib
import
closing
import
argparse
def
serve_args
():
def
serve_args
():
...
...
python/paddle_serving_server_gpu/web_serve.py
浏览文件 @
4969600f
...
@@ -27,10 +27,13 @@ if __name__ == "__main__":
...
@@ -27,10 +27,13 @@ if __name__ == "__main__":
args
=
serve_args
()
args
=
serve_args
()
web_service
=
WebService
(
name
=
args
.
name
)
web_service
=
WebService
(
name
=
args
.
name
)
web_service
.
load_model_config
(
args
.
model
)
web_service
.
load_model_config
(
args
.
model
)
gpu_ids
=
[]
if
args
.
gpu_ids
==
""
:
if
args
.
gpu_ids
==
""
:
gpu_ids
=
os
.
environ
[
"CUDA_VISIBLE_DEVICES"
]
if
"CUDA_VISIBLE_DEVICES"
in
os
.
environ
:
gpus
=
[
int
(
x
)
for
x
in
gpu_ids
.
split
(
","
)]
gpu_ids
=
os
.
environ
[
"CUDA_VISIBLE_DEVICES"
]
web_service
.
set_gpus
(
gpus
)
if
len
(
gpu_ids
)
>
0
:
gpus
=
[
int
(
x
)
for
x
in
gpu_ids
.
split
(
","
)]
web_service
.
set_gpus
(
gpus
)
web_service
.
prepare_server
(
web_service
.
prepare_server
(
workdir
=
args
.
workdir
,
port
=
args
.
port
,
device
=
args
.
device
)
workdir
=
args
.
workdir
,
port
=
args
.
port
,
device
=
args
.
device
)
service
.
run_server
()
service
.
run_server
()
python/paddle_serving_server_gpu/web_service.py
浏览文件 @
4969600f
...
@@ -112,7 +112,7 @@ class WebService(object):
...
@@ -112,7 +112,7 @@ class WebService(object):
feed
=
request
.
json
,
fetch
=
fetch
,
fetch_map
=
fetch_map
)
feed
=
request
.
json
,
fetch
=
fetch
,
fetch_map
=
fetch_map
)
return
fetch_map
return
fetch_map
app_instance
.
run
(
host
=
"
127.0.0.1
"
,
app_instance
.
run
(
host
=
"
0.0.0.0
"
,
port
=
self
.
port
,
port
=
self
.
port
,
threaded
=
False
,
threaded
=
False
,
processes
=
1
)
processes
=
1
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录