test_server.py 646 字节
Newer Older
G
guru4elephant 已提交
1 2 3 4 5 6 7 8 9
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')
10
response_op = op_maker.create('general_response')
G
guru4elephant 已提交
11 12 13 14

op_seq_maker = OpSeqMaker()
op_seq_maker.add_op(read_op)
op_seq_maker.add_op(general_infer_op)
15
op_seq_maker.add_op(response_op)
G
guru4elephant 已提交
16 17 18 19 20 21

server = Server()
server.set_op_sequence(op_seq_maker.get_op_sequence())
server.load_model_config(sys.argv[1])
server.prepare_server(workdir="work_dir1", port=9292, device="cpu")
server.run_server()