ERNIE-UIE
2023-03-06 10:20:52
https://aistudio.baidu.com/aistudio/modelsdetail?modelId=22
https://blog.csdn.net/weixin_44826203/article/details/125836420
https://blog.csdn.net/weixin_45609519/article/details/127208212
1.创建新项目,如PaddleNLPSimpleServing
2.安装依赖
python -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
python -m pip install --upgrade paddlenlp -i https://mirror.baidu.com/pypi/simple
GPU:
python -m pip install paddlepaddle-gpu==2.4.2.post117 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html python -m pip install --upgrade paddlenlp>=2.0.0rc -i https://mirror.baidu.com/pypi/simple
3.下载模型,修改server.py模型路径
uie = Taskflow("sentiment_analysis", schema=schema,model="uie-senta-base", task_path="model/uie-senta-base/")
uie = Taskflow("sentiment_analysis", task_path="../model/uie-senta-base/", schema=schema,model="uie-senta-base", device_id=0)
4.Server服务启动
paddlenlp server server:app --workers 1 --host 0.0.0.0 --port 8189
5。supervisor启动
[group:ppinfoextrs] programs=ppinfoextr-8190 [program:ppinfoextr-8190] command=/opt/faq/nlp/ppinfoextrvenv/bin/paddlenlp server server:app --workers 1 --host 0.0.0.0 --port 8190 #脚本目录 directory=/opt/faq/nlp/ppinfoextrvenv/ user=root autorestart=true redirect_stderr=true stdout_logfile=/opt/faq/nlp/ppinfoextrvenv/server.log loglevel=info