Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
d8c1050a
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,发现更多精彩内容 >>
提交
d8c1050a
编写于
6月 15, 2020
作者:
B
barrierye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
for support py3
上级
f99da947
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
63 addition
and
11 deletion
+63
-11
python/paddle_serving_server/pyserver.py
python/paddle_serving_server/pyserver.py
+31
-5
python/paddle_serving_server_gpu/pyserver.py
python/paddle_serving_server_gpu/pyserver.py
+32
-6
未找到文件。
python/paddle_serving_server/pyserver.py
浏览文件 @
d8c1050a
...
...
@@ -15,9 +15,14 @@
import
threading
import
multiprocessing
import
multiprocessing.queues
import
Queue
import
os
import
sys
if
sys
.
version_info
.
major
==
2
:
import
Queue
elif
sys
.
version_info
.
major
==
3
:
import
queue
as
Queue
else
:
raise
Exception
(
"Error Python version"
)
import
os
import
paddle_serving_server
from
paddle_serving_client
import
MultiLangClient
as
Client
from
paddle_serving_client
import
MultiLangPredictFuture
...
...
@@ -1081,7 +1086,14 @@ class PyServer(object):
else
:
# create virtual op
virtual_op
=
None
virtual_op
=
VirtualOp
(
name
=
virtual_op_name_gen
.
next
())
if
sys
.
version_info
.
major
==
2
:
virtual_op
=
VirtualOp
(
name
=
virtual_op_name_gen
.
next
())
elif
sys
.
version_info
.
major
==
3
:
virtual_op
=
VirtualOp
(
name
=
virtual_op_name_gen
.
__next__
())
else
:
raise
Exception
(
"Error Python version"
)
virtual_ops
.
append
(
virtual_op
)
outdegs
[
virtual_op
.
name
]
=
[
succ_op
]
actual_next_view
.
append
(
virtual_op
)
...
...
@@ -1093,7 +1105,14 @@ class PyServer(object):
for
o_idx
,
op
in
enumerate
(
actual_next_view
):
if
op
.
name
in
processed_op
:
continue
channel
=
Channel
(
self
.
_manager
,
name
=
channel_name_gen
.
next
())
if
sys
.
version_info
.
major
==
2
:
channel
=
Channel
(
self
.
_manager
,
name
=
channel_name_gen
.
next
())
elif
sys
.
version_info
.
major
==
3
:
channel
=
Channel
(
self
.
_manager
,
name
=
channel_name_gen
.
__next__
())
else
:
raise
Exception
(
"Error Python version"
)
channels
.
append
(
channel
)
logging
.
debug
(
"{} => {}"
.
format
(
channel
.
name
,
op
.
name
))
op
.
add_input_channel
(
channel
)
...
...
@@ -1124,7 +1143,14 @@ class PyServer(object):
other_op
.
name
))
other_op
.
add_input_channel
(
channel
)
processed_op
.
add
(
other_op
.
name
)
output_channel
=
Channel
(
self
.
_manager
,
name
=
channel_name_gen
.
next
())
if
sys
.
version_info
.
major
==
2
:
output_channel
=
Channel
(
self
.
_manager
,
name
=
channel_name_gen
.
next
())
elif
sys
.
version_info
.
major
==
3
:
output_channel
=
Channel
(
self
.
_manager
,
name
=
channel_name_gen
.
__next__
())
else
:
raise
Exception
(
"Error Python version"
)
channels
.
append
(
output_channel
)
last_op
=
dag_views
[
-
1
][
0
]
last_op
.
add_output_channel
(
output_channel
)
...
...
python/paddle_serving_server_gpu/pyserver.py
浏览文件 @
d8c1050a
...
...
@@ -15,10 +15,15 @@
import
threading
import
multiprocessing
import
multiprocessing.queues
import
Queue
import
os
import
sys
import
paddle_serving_server
if
sys
.
version_info
.
major
==
2
:
import
Queue
elif
sys
.
version_info
.
major
==
3
:
import
queue
as
Queue
else
:
raise
Exception
(
"Error Python version"
)
import
os
import
paddle_serving_server_gpu
from
paddle_serving_client
import
MultiLangClient
as
Client
from
paddle_serving_client
import
MultiLangPredictFuture
from
concurrent
import
futures
...
...
@@ -1081,7 +1086,14 @@ class PyServer(object):
else
:
# create virtual op
virtual_op
=
None
virtual_op
=
VirtualOp
(
name
=
virtual_op_name_gen
.
next
())
if
sys
.
version_info
.
major
==
2
:
virtual_op
=
VirtualOp
(
name
=
virtual_op_name_gen
.
next
())
elif
sys
.
version_info
.
major
==
3
:
virtual_op
=
VirtualOp
(
name
=
virtual_op_name_gen
.
__next__
())
else
:
raise
Exception
(
"Error Python version"
)
virtual_ops
.
append
(
virtual_op
)
outdegs
[
virtual_op
.
name
]
=
[
succ_op
]
actual_next_view
.
append
(
virtual_op
)
...
...
@@ -1093,7 +1105,14 @@ class PyServer(object):
for
o_idx
,
op
in
enumerate
(
actual_next_view
):
if
op
.
name
in
processed_op
:
continue
channel
=
Channel
(
self
.
_manager
,
name
=
channel_name_gen
.
next
())
if
sys
.
version_info
.
major
==
2
:
channel
=
Channel
(
self
.
_manager
,
name
=
channel_name_gen
.
next
())
elif
sys
.
version_info
.
major
==
3
:
channel
=
Channel
(
self
.
_manager
,
name
=
channel_name_gen
.
__next__
())
else
:
raise
Exception
(
"Error Python version"
)
channels
.
append
(
channel
)
logging
.
debug
(
"{} => {}"
.
format
(
channel
.
name
,
op
.
name
))
op
.
add_input_channel
(
channel
)
...
...
@@ -1124,7 +1143,14 @@ class PyServer(object):
other_op
.
name
))
other_op
.
add_input_channel
(
channel
)
processed_op
.
add
(
other_op
.
name
)
output_channel
=
Channel
(
self
.
_manager
,
name
=
channel_name_gen
.
next
())
if
sys
.
version_info
.
major
==
2
:
output_channel
=
Channel
(
self
.
_manager
,
name
=
channel_name_gen
.
next
())
elif
sys
.
version_info
.
major
==
3
:
output_channel
=
Channel
(
self
.
_manager
,
name
=
channel_name_gen
.
__next__
())
else
:
raise
Exception
(
"Error Python version"
)
channels
.
append
(
output_channel
)
last_op
=
dag_views
[
-
1
][
0
]
last_op
.
add_output_channel
(
output_channel
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录