README.md 839 字节
Newer Older
1 2

## Prepare
Z
fix  
zhangjun 已提交
3 4
### download model and extract
```
Z
zhangjun 已提交
5 6
wget https://paddle-inference-dist.cdn.bcebos.com/PaddleLite/models_and_data_for_unittests/ernie.tar.gz
tar zxvf ernie.tar.gz
Z
fix  
zhangjun 已提交
7
```
8 9 10 11
### convert model
```
python3 -m paddle_serving_client.convert --dirname erine
```
Z
zhangjun 已提交
12 13 14 15 16
### or, you can get the serving saved model directly
```
wget https://paddle-serving.bj.bcebos.com/models/xpu/bert.tar.gz
tar zxvf bert.tar.gz 
```
Z
fix  
zhangjun 已提交
17 18 19 20 21 22
### Getting Dict and Sample Dataset

```
sh get_data.sh
```
this script will download Chinese Dictionary File vocab.txt and Chinese Sample Data data-c.txt
23 24 25 26 27 28 29 30 31 32 33 34 35 36

## RPC Service

### Start Service

```
python3 -m paddle_serving_server.serve --model serving_server --port 7704 --use_lite --use_xpu --ir_optim
```

### Client Prediction

```
head data-c.txt | python3 ernie_client.py --model serving_client/serving_client_conf.prototxt
```