提交 ec3eb64f 编写于 作者: G gongweibao

fix ci test=develop

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