From b97dfe443672e692ff58f50311809f21c8586601 Mon Sep 17 00:00:00 2001 From: HexToString <506181616@qq.com> Date: Tue, 20 Apr 2021 05:46:57 +0000 Subject: [PATCH] fix config bug --- python/paddle_serving_client/client.py | 9 ++++++++- python/paddle_serving_server/rpc_service.py | 7 +++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/python/paddle_serving_client/client.py b/python/paddle_serving_client/client.py index 8f1218b8..48ad112a 100755 --- a/python/paddle_serving_client/client.py +++ b/python/paddle_serving_client/client.py @@ -555,7 +555,14 @@ class MultiLangClient(object): ) resp = self.stub_.GetClientConfig(get_client_config_req) model_config_path_list = resp.client_config_str_list - self._parse_model_config(model_config_path_list) + file_path_list = [] + for single_model_config in model_config_path_list: + if os.path.isdir(single_model_config): + file_path_list.append("{}/serving_server_conf.prototxt".format( + single_model_config)) + elif os.path.isfile(single_model_config): + file_path_list.append(single_model_config) + self._parse_model_config(file_path_list) def _flatten_list(self, nested_list): for item in nested_list: diff --git a/python/paddle_serving_server/rpc_service.py b/python/paddle_serving_server/rpc_service.py index 60c0d4c2..d9d30283 100755 --- a/python/paddle_serving_server/rpc_service.py +++ b/python/paddle_serving_server/rpc_service.py @@ -36,8 +36,11 @@ class MultiLangServerServiceServicer(multi_lang_general_model_service_pb2_grpc. def _init_bclient(self, model_config_path_list, endpoints, timeout_ms=None): file_path_list = [] for single_model_config in model_config_path_list: - file_path_list.append("{}/serving_server_conf.prototxt".format( - single_model_config)) + if os.path.isdir(single_model_config): + file_path_list.append("{}/serving_server_conf.prototxt".format( + single_model_config)) + elif os.path.isfile(single_model_config): + file_path_list.append(single_model_config) from paddle_serving_client import Client self.bclient_ = Client() if timeout_ms is not None: -- GitLab