一、基础环境搭建
1、python3
准备相关的jar包 Index of /ftp/python/3.7.9/
scp Python-3.7.9.tgz root@192.168.1.245:/opt/dockerinstall/python3/
yum -y install gcc
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
tar -zxvf Python-3.7.9.tgz
mkdir /usr/local/python3
cd Python-3.7.9/
./configure --prefix=/usr/local/python3
make && make install
sudo ln -sf /usr/local/python3/bin/python3.7 /usr/bin/python3
sudo ln -sf /usr/local/python3/bin/pip3.7 /usr/bin/pip3
配置python3的路径
cat ~/.bashrc
vim ~/.bashrc
添加
export PATH="/usr/local/python3/bin:$PATH"
source ~/.bashrc
2、安装 paddlenlp 2.5.2
升级pip3
/usr/local/python3/bin/python3.7 -m pip install --upgrade pip
参考 飞桨PaddlePaddle-源于产业实践的开源深度学习平台
pip3 install paddlenlp==2.5.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
代码安装
参考:PaddleNLP/docs/get_started/installation.rst at develop · PaddlePaddle/PaddleNLP · GitHub
git clone https://github.com/PaddlePaddle/PaddleNLP.git 下载不了,用之前已下载的工程
多试几次 下载成功
最新的develop分支 没有applications目录,还是需要用之前已下载的工程
scp root@192.168.1.243:/opt/dockerinstall/PaddleNLP.tar.gz .
cd /opt/dockerinstall/PaddleNLP/applications/text_classification/multi_class/deploy/simple_serving
pip3 install paddlepaddle -i https://pypi.tuna.tsinghua.edu.cn/simple
启动命令
nohup python3 -m uvicorn main_new:app --host 192.168.1.245 --port 6001 --workers 4 > paddlenlpweb_new.log 2>&1 &