Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
d0356b6d
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,发现更多精彩内容 >>
提交
d0356b6d
编写于
6月 15, 2020
作者:
B
barrierye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clean up code
上级
d8c1050a
变更
5
展开全部
显示空白变更内容
内联
并排
Showing
5 changed file
with
2467 addition
and
275 deletion
+2467
-275
python/paddle_serving_server/pyserver.py
python/paddle_serving_server/pyserver.py
+141
-257
python/paddle_serving_server/pyserver_multiprocess.py
python/paddle_serving_server/pyserver_multiprocess.py
+1212
-0
python/paddle_serving_server/pyserver_multithread.py
python/paddle_serving_server/pyserver_multithread.py
+1101
-0
python/paddle_serving_server_gpu/pyserver_multiprocess.py
python/paddle_serving_server_gpu/pyserver_multiprocess.py
+12
-17
python/requirements.txt
python/requirements.txt
+1
-1
未找到文件。
python/paddle_serving_server/pyserver.py
浏览文件 @
d0356b6d
此差异已折叠。
点击以展开。
python/paddle_serving_server/pyserver_multiprocess.py
0 → 100644
浏览文件 @
d0356b6d
此差异已折叠。
点击以展开。
python/paddle_serving_server/pyserver_multithread.py
0 → 100644
浏览文件 @
d0356b6d
此差异已折叠。
点击以展开。
python/paddle_serving_server_gpu/pyserver.py
→
python/paddle_serving_server_gpu/pyserver
_multiprocess
.py
浏览文件 @
d0356b6d
...
...
@@ -49,6 +49,9 @@ class _TimeProfiler(object):
self
.
_enable
=
False
def
enable
(
self
,
enable
):
if
enable
:
raise
Exception
(
"profile cannot be used in multiprocess version temporarily"
)
self
.
_enable
=
enable
def
record
(
self
,
name_with_tag
):
...
...
@@ -368,17 +371,13 @@ class Channel(multiprocessing.queues.Queue):
logging
.
debug
(
self
.
_log
(
"{} try to get(with channel empty: {})"
.
format
(
op_name
,
self
.
empty
())))
# For Python2, after putting an object on an empty queue there may
# be an infinitessimal delay before the queue's :meth:`~Queue.empty`
# For queue multiprocess: after putting an object on
# an empty queue there may be an infinitessimal delay
# before the queue's :meth:`~Queue.empty`
# see more:
# - https://bugs.python.org/issue18277
# - https://hg.python.org/cpython/rev/860fc6a2bd21
if
sys
.
version_info
.
major
==
2
:
resp
=
self
.
get
(
timeout
=
1e-3
)
elif
sys
.
version_info
.
major
==
3
:
resp
=
self
.
get
(
timeout
=
0
)
else
:
raise
Exception
(
"Error Python version"
)
break
except
Queue
.
Empty
:
logging
.
debug
(
...
...
@@ -409,17 +408,13 @@ class Channel(multiprocessing.queues.Queue):
logging
.
debug
(
self
.
_log
(
"{} try to get(with channel size: {})"
.
format
(
op_name
,
self
.
qsize
())))
# For Python2, after putting an object on an empty queue there may
# be an infinitessimal delay before the queue's :meth:`~Queue.empty`
# For queue multiprocess: after putting an object on
# an empty queue there may be an infinitessimal delay
# before the queue's :meth:`~Queue.empty`
# see more:
# - https://bugs.python.org/issue18277
# - https://hg.python.org/cpython/rev/860fc6a2bd21
if
sys
.
version_info
.
major
==
2
:
channeldata
=
self
.
get
(
timeout
=
1e-3
)
elif
sys
.
version_info
.
major
==
3
:
channeldata
=
self
.
get
(
timeout
=
0
)
else
:
raise
Exception
(
"Error Python version"
)
self
.
_front_res
.
append
(
channeldata
)
break
except
Queue
.
Empty
:
...
...
@@ -584,7 +579,7 @@ class Op(object):
data_id
,
error_channeldata
=
None
,
None
if
isinstance
(
channeldata
,
dict
):
parsed_data
=
{}
key
=
channeldata
.
keys
(
)[
0
]
key
=
list
(
channeldata
.
keys
()
)[
0
]
data_id
=
channeldata
[
key
].
id
for
_
,
data
in
channeldata
.
items
():
if
data
.
ecode
!=
ChannelDataEcode
.
OK
.
value
:
...
...
python/requirements.txt
浏览文件 @
d0356b6d
numpy>=1.12, <=1.16.4 ; python_version<"3.5"
grpcio-tools>=1.28.1
grpcio>=1.28.1
func-timeout
=
=4.3.5
func-timeout
>
=4.3.5
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录