diff --git a/python/examples/grpc_impl_example/fit_a_line/test_batch_client.py b/python/examples/grpc_impl_example/fit_a_line/test_batch_client.py index 3a01040e5ba557974b38ff7e067eaca15e7ebdd0..0630a0a960e5e40a7507454feb57418c8cfbdc68 100644 --- a/python/examples/grpc_impl_example/fit_a_line/test_batch_client.py +++ b/python/examples/grpc_impl_example/fit_a_line/test_batch_client.py @@ -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["serving_status_code"] == 0: print(fetch_map) else: - print(fetch_map["status_code"]) + print(fetch_map["serving_status_code"]) diff --git a/python/examples/grpc_impl_example/fit_a_line/test_general_pb_client.py b/python/examples/grpc_impl_example/fit_a_line/test_general_pb_client.py index a5ad17e0315215432c2d058941a43996304342bb..b2744906b0dcd321f86a1b8117a78307e24578e5 100644 --- a/python/examples/grpc_impl_example/fit_a_line/test_general_pb_client.py +++ b/python/examples/grpc_impl_example/fit_a_line/test_general_pb_client.py @@ -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["serving_status_code"] == 0: print(fetch_map) else: - print(fetch_map["status_code"]) + print(fetch_map["serving_status_code"]) diff --git a/python/examples/grpc_impl_example/fit_a_line/test_numpy_input_client.py b/python/examples/grpc_impl_example/fit_a_line/test_numpy_input_client.py index 329eae6a656747f1f52f4c986acd1be7ed90ff4a..e98c1e87bb48613e4226cf5378063aec7c5b4093 100644 --- a/python/examples/grpc_impl_example/fit_a_line/test_numpy_input_client.py +++ b/python/examples/grpc_impl_example/fit_a_line/test_numpy_input_client.py @@ -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["serving_status_code"] == 0: print(fetch_map) else: - print(fetch_map["status_code"]) + print(fetch_map["serving_status_code"]) diff --git a/python/examples/grpc_impl_example/fit_a_line/test_sync_client.py b/python/examples/grpc_impl_example/fit_a_line/test_sync_client.py index 9f699846c70e16705004581f4ce2511986063942..89530dc2f2a33ef44b2dbde52975634f4b4d8295 100644 --- a/python/examples/grpc_impl_example/fit_a_line/test_sync_client.py +++ b/python/examples/grpc_impl_example/fit_a_line/test_sync_client.py @@ -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["serving_status_code"] == 0: print(fetch_map) else: - print(fetch_map["status_code"]) + print(fetch_map["serving_status_code"]) diff --git a/python/examples/grpc_impl_example/fit_a_line/test_timeout_client.py b/python/examples/grpc_impl_example/fit_a_line/test_timeout_client.py index 4a2c2cff304e7fd04f293f90833e9d7dd5cd373a..f90fab38533aabf3daa7627ee0b79c56892444dd 100644 --- a/python/examples/grpc_impl_example/fit_a_line/test_timeout_client.py +++ b/python/examples/grpc_impl_example/fit_a_line/test_timeout_client.py @@ -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["serving_status_code"] == 0: print(fetch_map) - elif fetch_map["status_code"] == grpc.StatusCode.DEADLINE_EXCEEDED: + elif fetch_map["serving_status_code"] == grpc.StatusCode.DEADLINE_EXCEEDED: print('timeout') else: - print(fetch_map["status_code"]) + print(fetch_map["serving_status_code"]) diff --git a/python/paddle_serving_client/__init__.py b/python/paddle_serving_client/__init__.py index d5d37c32cdbf9f5852bf96caad38a5515370f467..7362f469a1d4c3328d96df2f63b4018ee67d6cbf 100644 --- a/python/paddle_serving_client/__init__.py +++ b/python/paddle_serving_client/__init__.py @@ -569,7 +569,7 @@ class MultiLangClient(object): ret = list(multi_result_map.values())[0] else: ret = multi_result_map - ret["status_code"] = 0 + ret["serving_status_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 {"serving_status_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 {"serving_status_code": e.code()} return self.callback_func_(resp) def add_done_callback(self, fn):