部署文档
## 安装系统环境依赖
```bash
yum install python3-devel
sudo zypper install python3-devel
```
## 复制安装包
```bash
scp write-server0527.zip write:/root/ai-writing-server/gwreco/
```
## 创建虚拟环境
```bash
python3 -m venv gwreco-venv/
source gwreco-venv/bin/activate.fish
pip3 install --upgrade pip -i https://mirror.baidu.com/pypi/simple
pip3 install -i https://mirrors.aliyun.com/pypi/simple/ wheel
```
## 安装和部署
```bash
# 阿里镜像
pip3 install -i https://mirrors.aliyun.com/pypi/simple/ flask flask-cors jieba elasticsearch numpy nltk tqdm sacrebleu==1.4.10
# 百度镜像
pip3 install -i https://mirror.baidu.com/pypi/simple flask flask-cors jieba elasticsearch numpy nltk tqdm sacrebleu==1.4.10
```
## 初始化数据
```bash
cd gwreco/write-server/ES
python3 create.py
```
## 启动服务
```bash
python3 main.py
```
# 测试接口
```bash
curl -X POST http://127.0.0.1:8897/nextWord -d '{"sent":"“十四五”时期,是新时代全面推进实现社会主义现代化的开局期","topk":3}'
curl -X POST http://127.0.0.1:8897/nextSent -d '{"query":"“十四五”时期,是新时代全面推进实现社会主义现代化的开局期","topk":3}'
curl -X POST http://127.0.0.1:8897/nextPara -d '{"query":"“十四五”时期,是新时代全面推进实现社会主义现代化的开局期","topk":3}'
```