Skip to content

Fix grpc bug #1153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/examples/bert/bert_web_service_gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=doc-string-missing
from paddle_serving_server_gpu.web_service import WebService
from paddle_serving_server.web_service import WebService
from paddle_serving_app.reader import ChineseBertReader
import sys
import os
Expand Down
9 changes: 8 additions & 1 deletion python/paddle_serving_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,14 @@ def connect(self, endpoints):
)
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:
Expand Down
9 changes: 8 additions & 1 deletion python/paddle_serving_server/rpc_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,18 @@ def __init__(self, model_config_path_list, is_multi_model, endpoints):
self._parse_model_config(self.model_config_path_list)

def _init_bclient(self, model_config_path_list, endpoints, timeout_ms=None):
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)
from paddle_serving_client import Client
self.bclient_ = Client()
if timeout_ms is not None:
self.bclient_.set_rpc_timeout_ms(timeout_ms)
self.bclient_.load_client_config(model_config_path_list)
self.bclient_.load_client_config(file_path_list)
self.bclient_.connect(endpoints)

def _parse_model_config(self, model_config_path_list):
Expand Down