提交 ec3eb64f 编写于 作者: G gongweibao

fix ci test=develop

上级 5f89b3d1
...@@ -45,10 +45,9 @@ message ModelOutput { ...@@ -45,10 +45,9 @@ message ModelOutput {
optional string engine_name = 2; optional string engine_name = 2;
}; };
message EmptyRequest{ message EmptyRequest {};
};
message ServingConfig{ message ServingConfig {
required int32 max_batch_size = 1; required int32 max_batch_size = 1;
required string proto_txt = 2; required string proto_txt = 2;
}; };
......
...@@ -396,15 +396,14 @@ class MultiLangClient(object): ...@@ -396,15 +396,14 @@ class MultiLangClient(object):
self._parse_model_config(proto_txt) self._parse_model_config(proto_txt)
def _load_client_config(self): def _load_client_config(self):
req= pb2.EmptyRequest() req = pb2.EmptyRequest()
self._config = self.stub_.get_config(req) self._config = self.stub_.get_config(req)
self._parse_model_config(self._config.proto_txt) self._parse_model_config(self._config.proto_txt)
#print("config:", self._config) #print("config:", self._config)
def connect(self, endpoint, use_remote_config=True): def connect(self, endpoint, use_remote_config=True):
self.channel_ = grpc.insecure_channel(endpoint[0]) #TODO self.channel_ = grpc.insecure_channel(endpoint[0]) #TODO
self.stub_ = grpc_pb2.MultiLangGeneralModelServiceStub( self.stub_ = grpc_pb2.MultiLangGeneralModelServiceStub(self.channel_)
self.channel_)
if use_remote_config: if use_remote_config:
self._load_client_config() self._load_client_config()
...@@ -551,6 +550,7 @@ class MultiLangClient(object): ...@@ -551,6 +550,7 @@ class MultiLangClient(object):
is_python=is_python, is_python=is_python,
need_variant_tag=need_variant_tag)) need_variant_tag=need_variant_tag))
class MultiLangPredictFuture(object): class MultiLangPredictFuture(object):
def __init__(self, call_future, callback_func): def __init__(self, call_future, callback_func):
self.call_future_ = call_future self.call_future_ = call_future
......
...@@ -440,8 +440,7 @@ class Server(object): ...@@ -440,8 +440,7 @@ class Server(object):
os.system(command) os.system(command)
class MultiLangServerService( class MultiLangServerService(grpc_pb2.MultiLangGeneralModelService):
grpc_pb2.MultiLangGeneralModelService):
def __init__(self, model_config_path, endpoints): def __init__(self, model_config_path, endpoints):
from paddle_serving_client import Client from paddle_serving_client import Client
...@@ -547,7 +546,6 @@ class MultiLangServerService( ...@@ -547,7 +546,6 @@ class MultiLangServerService(
return self._pack_resp_package(data, fetch_names, is_python, tag) return self._pack_resp_package(data, fetch_names, is_python, tag)
class MultiLangServer(object): class MultiLangServer(object):
def __init__(self, worker_num=2): def __init__(self, worker_num=2):
self.bserver_ = Server() self.bserver_ = Server()
......
...@@ -484,8 +484,7 @@ class Server(object): ...@@ -484,8 +484,7 @@ class Server(object):
os.system(command) os.system(command)
class MultiLangServerService( class MultiLangServerService(grpc_pb2.MultiLangGeneralModelService):
grpc_pb2.MultiLangGeneralModelService):
def __init__(self, model_config_path, endpoints): def __init__(self, model_config_path, endpoints):
from paddle_serving_client import Client from paddle_serving_client import Client
...@@ -501,7 +500,6 @@ class MultiLangServerService( ...@@ -501,7 +500,6 @@ class MultiLangServerService(
self._max_batch_size = -1 # <=0:unknown self._max_batch_size = -1 # <=0:unknown
self._proto_txt = proto_txt self._proto_txt = proto_txt
def _parse_model_config(self, proto_txt): def _parse_model_config(self, proto_txt):
model_conf = m_config.GeneralModelConfig() model_conf = m_config.GeneralModelConfig()
model_conf = google.protobuf.text_format.Merge(proto_txt, model_conf) model_conf = google.protobuf.text_format.Merge(proto_txt, model_conf)
...@@ -597,7 +595,7 @@ class MultiLangServerService( ...@@ -597,7 +595,7 @@ class MultiLangServerService(
max_batch_size = os.getenv(key) max_batch_size = os.getenv(key)
if max_batch_size: if max_batch_size:
try: try:
max_batch_size=int(max_batch_size) max_batch_size = int(max_batch_size)
self._max_batch_size = max_batch_size self._max_batch_size = max_batch_size
except Exception as e: except Exception as e:
print("invalid value:{} of {}".format(max_batch_size, key)) print("invalid value:{} of {}".format(max_batch_size, key))
......
...@@ -23,7 +23,7 @@ info_content = open(info_py, 'r').readlines() ...@@ -23,7 +23,7 @@ info_content = open(info_py, 'r').readlines()
version_line = [ version_line = [
l.strip() for l in info_content if l.startswith('__version__') l.strip() for l in info_content if l.startswith('__version__')
][0] ][0]
exec (version_line) # produce __version__ exec(version_line) # produce __version__
setuptools.setup( setuptools.setup(
name="paddle-gpu-serving", name="paddle-gpu-serving",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册