README.md 782 字节
Newer Older
1
# Fit a line example, prediction through rpc service
J
Jiawei Wang 已提交
2 3 4 5

([简体中文](./README_CN.md)|English)

## Start rpc service
6 7 8 9 10
``` shell
sh get_data.sh
python test_server.py uci_housing_model/
```

J
Jiawei Wang 已提交
11
## Prediction
12 13 14 15
``` shell
python test_client.py uci_housing_client/serving_client_conf.prototxt
```

J
Jiawei Wang 已提交
16
## prediction through http service
17 18
Start a web service with default web service hosting modules
``` shell
D
dongdaxiang 已提交
19
python -m paddle_serving_server.serve --model uci_housing_model/ --thread 10 --name uci --port 9393 --name uci
20 21
```

J
Jiawei Wang 已提交
22
## Prediction through http post
23 24
``` shell
curl -H "Content-Type:application/json" -X POST -d '{"x": [0.0137, -0.1136, 0.2553, -0.0692, 0.0582, -0.0727, -0.1583, -0.0584, 0.6283, 0.4919, 0.1856, 0.0795, -0.0332], "fetch":["price"]}' http://127.0.0.1:9393/uci/prediction
B
barrierye 已提交
25
```