diff --git a/doc/BAIDU_KUNLUN_XPU_SERVING.md b/doc/BAIDU_KUNLUN_XPU_SERVING.md index 7bc501d634ae6ac6537642e41a43160ca866de49..c57ce515096253678c9222c96a3e57fcd9dd91e7 100644 --- a/doc/BAIDU_KUNLUN_XPU_SERVING.md +++ b/doc/BAIDU_KUNLUN_XPU_SERVING.md @@ -22,7 +22,7 @@ cmake -DPYTHON_INCLUDE_DIR=/usr/include/python3.7m/ \ -DSERVER=ON .. make -j10 ``` -You can run `make install` to produce the target in `./output` directory. Add `-DCMAKE_INSTALL_PREFIX=./output` to specify the output path to CMake command shown above。 +You can run `make install` to produce the target in `./output` directory. Add `-DCMAKE_INSTALL_PREFIX=./output` to specify the output path to CMake command shown above. Please specify `-DWITH_MKL=ON` on Intel CPU platform with AVX2 support. * Compile the Serving Client ``` mkdir -p client-build-arm && cd client-build-arm diff --git a/python/examples/xpu/bert/README.md b/python/examples/xpu/bert/README.md index fd8e756603db9298ffa66e4c79feabb3d47e2b3d..676ac361dde376b29ae73cae98bd34a28f55d469 100644 --- a/python/examples/xpu/bert/README.md +++ b/python/examples/xpu/bert/README.md @@ -26,7 +26,7 @@ this script will download Chinese Dictionary File vocab.txt and Chinese Sample D ### Start Service ``` -python3 bert_web_service.py serving_server 7703 +python3 -m paddle_serving_server.serve --model serving_server --port 7703 --use_lite --use_xpu --ir_optim ``` ### Client Prediction diff --git a/python/examples/xpu/bert/bert_client.py b/python/examples/xpu/bert/bert_client.py index 66c46d7cdc8da21b06b877f5c550da2a58ac24f6..db10425baf1e803d7866dc839bc268cb95882eb0 100644 --- a/python/examples/xpu/bert/bert_client.py +++ b/python/examples/xpu/bert/bert_client.py @@ -31,7 +31,7 @@ client.connect(endpoint_list) for line in sys.stdin: feed_dict = reader.process(line) for key in feed_dict.keys(): - feed_dict[key] = np.array(feed_dict[key]).reshape((128, 1)) + feed_dict[key] = np.array(feed_dict[key]).reshape((1, 128)) #print(feed_dict) - result = client.predict(feed=feed_dict, fetch=fetch, batch=False) + result = client.predict(feed=feed_dict, fetch=fetch, batch=True) print(result)