test_server.py 614 字节
Newer Older
G
guru4elephant 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
import os
import sys
from paddle_serving_server import OpMaker
from paddle_serving_server import OpSeqMaker
from paddle_serving_server import Server

op_maker = OpMaker()
read_op = op_maker.create('general_reader')
general_infer_op = op_maker.create('general_infer')

op_seq_maker = OpSeqMaker()
op_seq_maker.add_op(read_op)
op_seq_maker.add_op(general_infer_op)

server = Server()
server.set_op_sequence(op_seq_maker.get_op_sequence())
M
MRXLT 已提交
17
server.set_num_threads(12)
G
guru4elephant 已提交
18
server.load_model_config(sys.argv[1])
M
MRXLT 已提交
19 20
port = int(sys.argv[2])
server.prepare_server(workdir="work_dir1", port=port, device="cpu")
G
guru4elephant 已提交
21
server.run_server()