提交 fd554230 编写于 作者: M MRXLT

fix ut

上级 0e3fc482
...@@ -26,10 +26,10 @@ x = [ ...@@ -26,10 +26,10 @@ x = [
] ]
for i in range(3): for i in range(3):
fetch_map = client.predict(feed={"x": x}, fetch=["price"]) fetch_map = client.predict(feed={"x": x}, fetch=["price"])
if fetch_map["serving_grpc_error"] == 0: if fetch_map["serving_status_code"] == 0:
print(fetch_map) print(fetch_map)
elif fetch_map["serving_grpc_error"].code( elif fetch_map["serving_status_code"].code(
) == grpc.StatusCode.DEADLINE_EXCEEDED: ) == grpc.StatusCode.DEADLINE_EXCEEDED:
print('timeout') print('timeout')
else: else:
print(fetch_map["serving_grpc_error"]) print(fetch_map["serving_status_code"])
...@@ -643,7 +643,7 @@ class MultiLangClient(object): ...@@ -643,7 +643,7 @@ class MultiLangClient(object):
self.profile_.print_profile() self.profile_.print_profile()
return ret return ret
except grpc.RpcError as e: except grpc.RpcError as e:
return {"serving_grpc_error": e} return {"serving_status_code": e.code()}
else: else:
req = self._pack_inference_request( req = self._pack_inference_request(
feed, fetch, is_python=is_python, log_id=log_id) feed, fetch, is_python=is_python, log_id=log_id)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册