- clone 项目
git clone https://github.com/oobabooga/text-generation-webui
- install conda
curl -sL "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh" > "Miniconda3.sh"
bash Miniconda3.sh
- 环境准备
conda create -n textgen python=3.10.9
conda activate textgen
- 安装环境
pip install torch torchvision torchaudio
pip install -r requirements.txt
放在 text-generation-webui/models/ 目录下
链接: https://pan.baidu.com/s/1XGovdZ7OFZdFwfWoKW85ww 提取码: tf1j
cd text-generation-webui
python server.py --model chinese-alpaca-2-7b-hf --api --extensions openai --listen
cd ..
uvicorn main:app --reload --host 0.0.0.0 --port 8080
http://{server ip}:8001/docs