diff --git a/core/configure/proto/multi_lang_general_model_service.proto b/core/configure/proto/multi_lang_general_model_service.proto index fc6ac80517e8865d321226816caff2a916033e60..6e1764b23b3e6f7d9eb9a33925bcd83cfb1810bb 100644 --- a/core/configure/proto/multi_lang_general_model_service.proto +++ b/core/configure/proto/multi_lang_general_model_service.proto @@ -32,7 +32,7 @@ message Request { repeated FeedInst insts = 1; repeated string feed_var_names = 2; repeated string fetch_var_names = 3; - required bool is_python = 4 [ default = true ]; + required bool is_python = 4 [ default = false ]; }; message Response { diff --git a/python/paddle_serving_client/__init__.py b/python/paddle_serving_client/__init__.py index de650a5a0789af3c7c1d5114d82c9cb0b67c87f0..09a91809f52718eb7f52d234b3e8c5406883f419 100644 --- a/python/paddle_serving_client/__init__.py +++ b/python/paddle_serving_client/__init__.py @@ -21,7 +21,6 @@ import google.protobuf.text_format import numpy as np import time import sys -from .serving_client import PredictorRes import grpc from .proto import multi_lang_general_model_service_pb2 @@ -129,6 +128,8 @@ class Client(object): self.all_numpy_input = True self.has_numpy_input = False self.rpc_timeout_ms = 20000 + from .serving_client import PredictorRes + self.predictorres_constructor = PredictorRes def load_client_config(self, path): from .serving_client import PredictorClient @@ -308,7 +309,7 @@ class Client(object): self.profile_.record('py_prepro_1') self.profile_.record('py_client_infer_0') - result_batch_handle = PredictorRes() + result_batch_handle = self.predictorres_constructor() if self.all_numpy_input: res = self.client_handle_.numpy_predict( float_slot_batch, float_feed_names, float_shape, int_slot_batch, @@ -495,9 +496,11 @@ class MultiLangClient(object): raise Exception("error type.") else: if v_type == 0: # int64 - result_map[name] = np.array(list(var.int64_data)) + result_map[name] = np.array( + list(var.int64_data), dtype="int64") elif v_type == 1: # float32 - result_map[name] = np.array(list(var.float_data)) + result_map[name] = np.array( + list(var.float_data), dtype="float32") else: raise Exception("error type.") result_map[name].shape = list(var.shape)