From 4a7a66825cb043b9281225bc3093e4519dc15807 Mon Sep 17 00:00:00 2001 From: Jiawei Wang Date: Wed, 20 Jan 2021 20:03:20 +0800 Subject: [PATCH] fix PR#979 conflict --- python/paddle_serving_server_gpu/__init__.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/python/paddle_serving_server_gpu/__init__.py b/python/paddle_serving_server_gpu/__init__.py index b8fe91bb..b39c59b0 100644 --- a/python/paddle_serving_server_gpu/__init__.py +++ b/python/paddle_serving_server_gpu/__init__.py @@ -311,18 +311,19 @@ class Server(object): engine.static_optimization = False engine.force_update_static_cache = False engine.use_trt = self.use_trt - engine.use_lite = self.use_lite - engine.use_xpu = self.use_xpu - - - + if os.path.exists('{}/__params__'.format(model_config_path)): + suffix = "" + else: + suffix = "_DIR" + if device == "arm": + engine.use_lite = self.use_lite + engine.use_xpu = self.use_xpu if device == "cpu": - engine.type = "FLUID_CPU_ANALYSIS_DIR" + engine.type = "FLUID_CPU_ANALYSIS" + suffix elif device == "gpu": - engine.type = "FLUID_GPU_ANALYSIS_DIR" + engine.type = "FLUID_GPU_ANALYSIS" + suffix elif device == "arm": - engine.type = "FLUID_ARM_ANALYSIS_DIR" - + engine.type = "FLUID_ARM_ANALYSIS" + suffix self.model_toolkit_conf.engines.extend([engine]) def _prepare_infer_service(self, port): -- GitLab