提交 28e53bad 编写于 作者: M MRXLT

add gpuid argument

上级 082609e8
...@@ -34,7 +34,8 @@ def parse_args(): ...@@ -34,7 +34,8 @@ def parse_args():
default="workdir", default="workdir",
help="Working dir of current service") help="Working dir of current service")
parser.add_argument( parser.add_argument(
"--device", type=str, default="cpu", help="Type of device") "--device", type=str, default="gpu", help="Type of device")
parser.add_argument("--gpuid", type=int, default=0, help="Index of GPU")
return parser.parse_args() return parser.parse_args()
...@@ -45,6 +46,7 @@ def start_standard_model(): ...@@ -45,6 +46,7 @@ def start_standard_model():
port = args.port port = args.port
workdir = args.workdir workdir = args.workdir
device = args.device device = args.device
gpuid = args.gpuid
if model == "": if model == "":
print("You must specify your serving model") print("You must specify your serving model")
...@@ -67,6 +69,7 @@ def start_standard_model(): ...@@ -67,6 +69,7 @@ def start_standard_model():
server.load_model_config(model) server.load_model_config(model)
server.prepare_server(workdir=workdir, port=port, device=device) server.prepare_server(workdir=workdir, port=port, device=device)
server.set_gpuid(gpuid)
server.run_server() server.run_server()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册