安装Paddle-ChatDocuments大模型

利用LangChain和ChatGLM-6B系列模型制作的Webui, 提供基于本地知识的大模型应用.

环境安装

项目依赖PaddlePaddle develolop版本和最新的PaddleNLP(更推荐在终端里安装)

安装PaddlePaddle Develop版本

In [1]

## 卸载环境中原有的旧PaddlePaddle版本
!pip uninstall paddlepaddle-gpu -y
WARNING: Ignoring invalid distribution -umpy (/opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -umpy (/opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages)
Found existing installation: paddlepaddle-gpu 0.0.0.post112
Uninstalling paddlepaddle-gpu-0.0.0.post112:
  Successfully uninstalled paddlepaddle-gpu-0.0.0.post112

In [2]

# 安装paddlepaddle-gpu develop版本
!python -m pip install paddlepaddle-gpu==0.0.0.post112 -f https://www.paddlepaddle.org.cn/whl/linux/gpu/develop.html
WARNING: Ignoring invalid distribution -umpy (/opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -umpy (/opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Looking in links: https://www.paddlepaddle.org.cn/whl/linux/gpu/develop.html
Collecting paddlepaddle-gpu==0.0.0.post112
  Using cached https://paddle-wheel.bj.bcebos.com/develop/linux/linux-gpu-cuda11.2-cudnn8-mkl-gcc8.2-avx/paddlepaddle_gpu-0.0.0.post112-cp39-cp39-linux_x86_64.whl (679.5 MB)
Requirement already satisfied: paddle-bfloat==0.1.7 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlepaddle-gpu==0.0.0.post112) (0.1.7)
Requirement already satisfied: opt-einsum==3.3.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlepaddle-gpu==0.0.0.post112) (3.3.0)
Requirement already satisfied: protobuf>=3.20.2 in ./.data/webide/pip/lib/python3.9/site-packages (from paddlepaddle-gpu==0.0.0.post112) (3.20.2)
Requirement already satisfied: requests>=2.20.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlepaddle-gpu==0.0.0.post112) (2.24.0)
Requirement already satisfied: numpy>=1.13 in ./.data/webide/pip/lib/python3.9/site-packages (from paddlepaddle-gpu==0.0.0.post112) (1.22.4)
Requirement already satisfied: astor in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlepaddle-gpu==0.0.0.post112) (0.8.1)
Requirement already satisfied: decorator in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlepaddle-gpu==0.0.0.post112) (4.4.2)
Requirement already satisfied: Pillow in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlepaddle-gpu==0.0.0.post112) (8.2.0)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from requests>=2.20.0->paddlepaddle-gpu==0.0.0.post112) (1.25.11)
Requirement already satisfied: chardet<4,>=3.0.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from requests>=2.20.0->paddlepaddle-gpu==0.0.0.post112) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from requests>=2.20.0->paddlepaddle-gpu==0.0.0.post112) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in ./.data/webide/pip/lib/python3.9/site-packages (from requests>=2.20.0->paddlepaddle-gpu==0.0.0.post112) (2023.5.7)
WARNING: Ignoring invalid distribution -umpy (/opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages)
Installing collected packages: paddlepaddle-gpu
WARNING: Ignoring invalid distribution -umpy (/opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages)
Successfully installed paddlepaddle-gpu-0.0.0.post112
WARNING: Ignoring invalid distribution -umpy (/opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -umpy (/opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -umpy (/opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages)

[notice] A new release of pip available: 22.1.2 -> 23.1.2
[notice] To update, run: pip install --upgrade pip

安装PaddleNLP最新版本

In [ ]

## 安装方式1:源码安装
### clone PaddleNLP
%cd /home/aistudio
!git clone https://openi.pcl.ac.cn/PaddlePaddle/PaddleNLP.git -b develop

### 源码安装PaddleNLP
%cd /home/aistudio/PaddleNLP
!pip install -e . --user

In [3]

## 安装方式2:通过给定的.whl安装(更推荐)
%cd /home/aistudio/LangChain-ChatGLM-Webui/paddlepaddle
!pip install ./paddlenlp-2.5.2.post0-py3-none-any.whl --user
/home/aistudio/LangChain-ChatGLM-Webui/paddlepaddle
WARNING: Ignoring invalid distribution -umpy (/opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -umpy (/opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing ./paddlenlp-2.5.2.post0-py3-none-any.whl
Requirement already satisfied: colorlog in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (4.1.0)
Requirement already satisfied: visualdl in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (2.4.0)
Requirement already satisfied: Flask-Babel in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (3.0.1)
Requirement already satisfied: protobuf==3.20.2 in /home/aistudio/.data/webide/pip/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (3.20.2)
Requirement already satisfied: tqdm in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (4.64.1)
Requirement already satisfied: paddlefsl in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (1.1.0)
Requirement already satisfied: paddle2onnx in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (1.0.0)
Requirement already satisfied: rich in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (12.6.0)
Requirement already satisfied: seqeval in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (1.2.2)
Requirement already satisfied: multiprocess<=0.70.12.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (0.70.11.1)
Requirement already satisfied: uvicorn in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (0.20.0)
Requirement already satisfied: datasets>=2.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (2.7.0)
Requirement already satisfied: sentencepiece in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (0.1.96)
Requirement already satisfied: jieba in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (0.42.1)
Requirement already satisfied: dill<0.3.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (0.3.3)
Requirement already satisfied: huggingface-hub>=0.11.1 in /home/aistudio/.data/webide/pip/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (0.14.1)
Requirement already satisfied: colorama in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (0.4.4)
Requirement already satisfied: fastapi in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (0.90.1)
Requirement already satisfied: typer in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from paddlenlp==2.5.2.post0) (0.7.0)
Requirement already satisfied: responses<0.19 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from datasets>=2.0.0->paddlenlp==2.5.2.post0) (0.18.0)
Requirement already satisfied: pyarrow>=6.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from datasets>=2.0.0->paddlenlp==2.5.2.post0) (10.0.0)
Requirement already satisfied: packaging in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from datasets>=2.0.0->paddlenlp==2.5.2.post0) (21.3)
Requirement already satisfied: numpy>=1.17 in /home/aistudio/.data/webide/pip/lib/python3.9/site-packages (from datasets>=2.0.0->paddlenlp==2.5.2.post0) (1.22.4)
Requirement already satisfied: xxhash in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from datasets>=2.0.0->paddlenlp==2.5.2.post0) (3.1.0)
Requirement already satisfied: pyyaml>=5.1 in /home/aistudio/.data/webide/pip/lib/python3.9/site-packages (from datasets>=2.0.0->paddlenlp==2.5.2.post0) (6.0)
Requirement already satisfied: requests>=2.19.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from datasets>=2.0.0->paddlenlp==2.5.2.post0) (2.24.0)
Requirement already satisfied: aiohttp in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from datasets>=2.0.0->paddlenlp==2.5.2.post0) (3.8.3)
Requirement already satisfied: fsspec[http]>=2021.11.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from datasets>=2.0.0->paddlenlp==2.5.2.post0) (2022.11.0)
Requirement already satisfied: pandas in /home/aistudio/.data/webide/pip/lib/python3.9/site-packages (from datasets>=2.0.0->paddlenlp==2.5.2.post0) (1.5.3)
Requirement already satisfied: typing-extensions>=3.7.4.3 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from huggingface-hub>=0.11.1->paddlenlp==2.5.2.post0) (4.3.0)
Requirement already satisfied: filelock in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from huggingface-hub>=0.11.1->paddlenlp==2.5.2.post0) (3.9.0)
Requirement already satisfied: starlette<0.24.0,>=0.22.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from fastapi->paddlenlp==2.5.2.post0) (0.23.1)
Requirement already satisfied: pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from fastapi->paddlenlp==2.5.2.post0) (1.10.4)
Requirement already satisfied: Jinja2<4.0.0,>=3.1.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from Flask-Babel->paddlenlp==2.5.2.post0) (3.1.2)
Requirement already satisfied: Babel<3.0.0,>=2.11.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from Flask-Babel->paddlenlp==2.5.2.post0) (2.11.0)
Requirement already satisfied: pytz<2023.0,>=2022.7 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from Flask-Babel->paddlenlp==2.5.2.post0) (2022.7.1)
Requirement already satisfied: Flask<3.0.0,>=2.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from Flask-Babel->paddlenlp==2.5.2.post0) (2.1.3)
Requirement already satisfied: commonmark<0.10.0,>=0.9.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from rich->paddlenlp==2.5.2.post0) (0.9.1)
Requirement already satisfied: pygments<3.0.0,>=2.6.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from rich->paddlenlp==2.5.2.post0) (2.13.0)
Requirement already satisfied: scikit-learn>=0.21.3 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from seqeval->paddlenlp==2.5.2.post0) (0.24.2)
Requirement already satisfied: click<9.0.0,>=7.1.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from typer->paddlenlp==2.5.2.post0) (8.0.4)
Requirement already satisfied: h11>=0.8 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from uvicorn->paddlenlp==2.5.2.post0) (0.14.0)
Requirement already satisfied: matplotlib in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from visualdl->paddlenlp==2.5.2.post0) (2.2.3)
Requirement already satisfied: six>=1.14.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from visualdl->paddlenlp==2.5.2.post0) (1.16.0)
Requirement already satisfied: bce-python-sdk in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from visualdl->paddlenlp==2.5.2.post0) (0.8.53)
Requirement already satisfied: Pillow>=7.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from visualdl->paddlenlp==2.5.2.post0) (8.2.0)
Requirement already satisfied: Werkzeug>=2.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from Flask<3.0.0,>=2.0.0->Flask-Babel->paddlenlp==2.5.2.post0) (2.1.2)
Requirement already satisfied: importlib-metadata>=3.6.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from Flask<3.0.0,>=2.0.0->Flask-Babel->paddlenlp==2.5.2.post0) (6.0.0)
Requirement already satisfied: itsdangerous>=2.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.9/site-packages (from Flask<3.0.0,>=2.0.0->Flask-Bab
  • 31
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值