提交 a3250b6f 编写于 作者: F felixhjh

modify web_service to load gpu.yml and cpu.yml

上级 96a8ead3
......@@ -16,9 +16,20 @@ from paddle_serving_server.web_service import WebService, Op
import logging
import numpy as np
import sys
import argparse
_LOGGER = logging.getLogger()
def serve_args():
parser = argparse.ArgumentParser("serve")
parser.add_argument(
"config",
type=str,
default="config.yml",
nargs="?",
help="cpu or gpu config.yml")
return parser.parse_args()
class UciOp(Op):
def init_op(self):
......@@ -53,7 +64,7 @@ class UciService(WebService):
uci_op = UciOp(name="uci", input_ops=[read_op])
return uci_op
args = serve_args()
uci_service = UciService(name="uci")
uci_service.prepare_pipeline_config("config.yml")
uci_service.prepare_pipeline_config(args.config)
uci_service.run_service()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册