Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
b3b257e6
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看板
提交
b3b257e6
编写于
6月 22, 2020
作者:
B
barrierye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change status_code to serving_status_code
上级
682461fe
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
14 addition
and
14 deletion
+14
-14
python/examples/grpc_impl_example/fit_a_line/test_batch_client.py
...xamples/grpc_impl_example/fit_a_line/test_batch_client.py
+2
-2
python/examples/grpc_impl_example/fit_a_line/test_general_pb_client.py
...es/grpc_impl_example/fit_a_line/test_general_pb_client.py
+2
-2
python/examples/grpc_impl_example/fit_a_line/test_numpy_input_client.py
...s/grpc_impl_example/fit_a_line/test_numpy_input_client.py
+2
-2
python/examples/grpc_impl_example/fit_a_line/test_sync_client.py
...examples/grpc_impl_example/fit_a_line/test_sync_client.py
+2
-2
python/examples/grpc_impl_example/fit_a_line/test_timeout_client.py
...mples/grpc_impl_example/fit_a_line/test_timeout_client.py
+3
-3
python/paddle_serving_client/__init__.py
python/paddle_serving_client/__init__.py
+3
-3
未找到文件。
python/examples/grpc_impl_example/fit_a_line/test_batch_client.py
浏览文件 @
b3b257e6
...
...
@@ -26,7 +26,7 @@ x = [
for
i
in
range
(
3
):
batch_feed
=
[{
"x"
:
x
}
for
j
in
range
(
batch_size
)]
fetch_map
=
client
.
predict
(
feed
=
batch_feed
,
fetch
=
[
"price"
])
if
fetch_map
[
"status_code"
]
==
0
:
if
fetch_map
[
"s
erving_s
tatus_code"
]
==
0
:
print
(
fetch_map
)
else
:
print
(
fetch_map
[
"status_code"
])
print
(
fetch_map
[
"s
erving_s
tatus_code"
])
python/examples/grpc_impl_example/fit_a_line/test_general_pb_client.py
浏览文件 @
b3b257e6
...
...
@@ -24,7 +24,7 @@ x = [
]
for
i
in
range
(
3
):
fetch_map
=
client
.
predict
(
feed
=
{
"x"
:
x
},
fetch
=
[
"price"
],
is_python
=
False
)
if
fetch_map
[
"status_code"
]
==
0
:
if
fetch_map
[
"s
erving_s
tatus_code"
]
==
0
:
print
(
fetch_map
)
else
:
print
(
fetch_map
[
"status_code"
])
print
(
fetch_map
[
"s
erving_s
tatus_code"
])
python/examples/grpc_impl_example/fit_a_line/test_numpy_input_client.py
浏览文件 @
b3b257e6
...
...
@@ -25,7 +25,7 @@ x = [
]
for
i
in
range
(
3
):
fetch_map
=
client
.
predict
(
feed
=
{
"x"
:
np
.
array
(
x
)},
fetch
=
[
"price"
])
if
fetch_map
[
"status_code"
]
==
0
:
if
fetch_map
[
"s
erving_s
tatus_code"
]
==
0
:
print
(
fetch_map
)
else
:
print
(
fetch_map
[
"status_code"
])
print
(
fetch_map
[
"s
erving_s
tatus_code"
])
python/examples/grpc_impl_example/fit_a_line/test_sync_client.py
浏览文件 @
b3b257e6
...
...
@@ -24,7 +24,7 @@ x = [
]
for
i
in
range
(
3
):
fetch_map
=
client
.
predict
(
feed
=
{
"x"
:
x
},
fetch
=
[
"price"
])
if
fetch_map
[
"status_code"
]
==
0
:
if
fetch_map
[
"s
erving_s
tatus_code"
]
==
0
:
print
(
fetch_map
)
else
:
print
(
fetch_map
[
"status_code"
])
print
(
fetch_map
[
"s
erving_s
tatus_code"
])
python/examples/grpc_impl_example/fit_a_line/test_timeout_client.py
浏览文件 @
b3b257e6
...
...
@@ -26,9 +26,9 @@ x = [
]
for
i
in
range
(
3
):
fetch_map
=
client
.
predict
(
feed
=
{
"x"
:
x
},
fetch
=
[
"price"
])
if
fetch_map
[
"status_code"
]
==
0
:
if
fetch_map
[
"s
erving_s
tatus_code"
]
==
0
:
print
(
fetch_map
)
elif
fetch_map
[
"status_code"
]
==
grpc
.
StatusCode
.
DEADLINE_EXCEEDED
:
elif
fetch_map
[
"s
erving_s
tatus_code"
]
==
grpc
.
StatusCode
.
DEADLINE_EXCEEDED
:
print
(
'timeout'
)
else
:
print
(
fetch_map
[
"status_code"
])
print
(
fetch_map
[
"s
erving_s
tatus_code"
])
python/paddle_serving_client/__init__.py
浏览文件 @
b3b257e6
...
...
@@ -569,7 +569,7 @@ class MultiLangClient(object):
ret
=
list
(
multi_result_map
.
values
())[
0
]
else
:
ret
=
multi_result_map
ret
[
"status_code"
]
=
0
ret
[
"s
erving_s
tatus_code"
]
=
0
return
ret
if
not
need_variant_tag
else
[
ret
,
tag
]
def
_done_callback_func
(
self
,
fetch
,
is_python
,
need_variant_tag
):
...
...
@@ -598,7 +598,7 @@ class MultiLangClient(object):
is_python
=
is_python
,
need_variant_tag
=
need_variant_tag
)
except
grpc
.
RpcError
as
e
:
return
{
"status_code"
:
e
.
code
()}
return
{
"s
erving_s
tatus_code"
:
e
.
code
()}
else
:
call_future
=
self
.
stub_
.
Inference
.
future
(
req
,
timeout
=
self
.
rpc_timeout_s_
)
...
...
@@ -619,7 +619,7 @@ class MultiLangPredictFuture(object):
try
:
resp
=
self
.
call_future_
.
result
()
except
grpc
.
RpcError
as
e
:
return
{
"status_code"
:
e
.
code
()}
return
{
"s
erving_s
tatus_code"
:
e
.
code
()}
return
self
.
callback_func_
(
resp
)
def
add_done_callback
(
self
,
fn
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录