From 71db09b5f19a5a1383014bfbc4896fa769bdea04 Mon Sep 17 00:00:00 2001 From: MRXLT Date: Wed, 26 Feb 2020 17:00:55 +0800 Subject: [PATCH] remove set_local_bin --- python/paddle_serving_server/__init__.py | 10 ++++++---- python/paddle_serving_server_gpu/__init__.py | 10 +++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/python/paddle_serving_server/__init__.py b/python/paddle_serving_server/__init__.py index 6f85bdc5..70251cff 100644 --- a/python/paddle_serving_server/__init__.py +++ b/python/paddle_serving_server/__init__.py @@ -109,9 +109,10 @@ class Server(object): def set_memory_optimize(self, flag=False): self.memory_optimization = flag - def set_local_bin(self, path): - self.use_local_bin = True - self.bin_path = path + def check_local_bin(self): + if "SERVING_BIN" in os.environ: + self.use_local_bin = True + self.bin_path = os.environ["SERVING_BIN"] def _prepare_engine(self, model_config_path, device): if self.model_toolkit_conf == None: @@ -258,10 +259,11 @@ class Server(object): def run_server(self): # just run server with system command # currently we do not load cube + self.check_local_bin() if not self.use_local_bin: self.download_bin() else: - print("Use local bin") + print("Use local bin : {}".format(self.bin_path)) command = "{} " \ "-enable_model_toolkit " \ "-inferservice_path {} " \ diff --git a/python/paddle_serving_server_gpu/__init__.py b/python/paddle_serving_server_gpu/__init__.py index 1cb860c7..4372884a 100644 --- a/python/paddle_serving_server_gpu/__init__.py +++ b/python/paddle_serving_server_gpu/__init__.py @@ -109,9 +109,10 @@ class Server(object): def set_memory_optimize(self, flag=False): self.memory_optimization = flag - def set_local_bin(self, path): - self.use_local_bin = True - self.bin_path = path + def check_local_bin(self): + if "SERVING_BIN" in os.environ: + self.use_local_bin = True + self.bin_path = os.environ["SERVING_BIN"] def set_gpuid(self, gpuid=0): self.gpuid = gpuid @@ -243,8 +244,11 @@ class Server(object): def run_server(self): # just run server with system command # currently we do not load cube + self.check_local_bin() if not self.use_local_bin: self.download_bin() + else: + print("Use local bin : {}".format(self.bin_path)) command = "{} " \ "-enable_model_toolkit " \ "-inferservice_path {} " \ -- GitLab