text-generation-webui搭建大模型运行环境
- text-generation-webui
- 环境初始化
- 安装项目依赖
- 命令方式
- 脚本方式
- 准备模型
- 启动项目
- 加载模型
- Bug说明
- Bug1
- Bug2
text-generation-webui
text-generation-webui是一个基于Gradio的LLM Web UI开源项目,可以利用其快速搭建部署各种大模型环境。
环境初始化
下载该开源项目
git clone https://github.com/oobabooga/text-generation-webui.git
创建conda环境并进入
conda create -n ui python=3.10 conda activate ui
安装项目依赖
命令方式
cd text-generation-webui pip install -r requirements.txt
在安装text-generation-webui项目的依赖库文件时,出现如下异常:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(, 'Connection to github.com timed out. (connect timeout=15)')': /oobabooga/llama-cpp-python-cuBLAS-wheels/releases/download/cpu/llama_cpp_python-0.2.24+cpuavx2-cp310-cp310-manylinux_2_31_x86_64.whl
解决方案:
pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
注意:
这里最大一个问题是:requirements.txt中存在大量GitHub项目中的文件,需要访问GitHub,其速度不言而喻,如果是云服务器中特别注意一点,不要使用proxy服务器,直接在该服务器上安装proxy服务
脚本方式
直接运行项目目录下的start_linux.sh脚本,其会自动安装相关依赖,然后启动项目,方便快捷,推荐使用。
(ui) root@master:~/work/text-generation-webui# ./start_linux.sh Downloading Miniconda from https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-Linux-x86_64.sh to /root/work/text-generation-webui/installer_files/miniconda_installer.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 69.7M 100 69.7M 0 0 9639k 0 0:00:07 0:00:07 --:--:-- 13.2M PREFIX=/root/work/text-generation-webui/installer_files/conda Unpacking payload ... Installing base environment... Downloading and Extracting Packages Downloading and Extracting Packages Preparing transaction: done Executing transaction: done installation finished. Miniconda version: conda 23.3.1 Collecting package metadata (current_repodata.json): done Solving environment: done ==> WARNING: A newer version of conda exists. A Do you want to use CUDA 11.8 instead of 12.1? Only choose this option if your GPU is very old (Kepler or older). For RTX and GTX series GPUs, say "N". If unsure, say "N". Input (Y/N)> N CUDA: 12.1 ******************************************************************* * Installing PyTorch. ******************************************************************* Collecting package metadata (current_repodata.json): done Solving environment: done ==> WARNING: A newer version of conda exists.