From ef889659494a39149c4317d738a91b2c03639417 Mon Sep 17 00:00:00 2001 From: HexToString <506181616@qq.com> Date: Mon, 2 Aug 2021 11:20:34 +0000 Subject: [PATCH] add http client --- python/examples/fit_a_line/README.md | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/python/examples/fit_a_line/README.md b/python/examples/fit_a_line/README.md index 77583ce5..3a16316e 100644 --- a/python/examples/fit_a_line/README.md +++ b/python/examples/fit_a_line/README.md @@ -18,30 +18,21 @@ sh get_data.sh python -m paddle_serving_server.serve --model uci_housing_model --thread 10 --port 9393 ``` -### Client prediction +## Client prediction +### RPC Client The `paddlepaddle` package is used in `test_client.py`, and you may need to download the corresponding package(`pip install paddlepaddle`). ``` shell python test_client.py uci_housing_client/serving_client_conf.prototxt ``` +### Http Client - -## HTTP service - -### Start server - -Start a web service with default web service hosting modules: ``` shell -python -m paddle_serving_server.serve --model uci_housing_model --thread 10 --port 9393 --name uci +python test_httpclient.py uci_housing_client/serving_client_conf.prototxt ``` -### Client prediction - -``` shell -curl -H "Content-Type:application/json" -X POST -d '{"feed":[{"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 -``` ## Benchmark ``` shell -- GitLab