0. 配置环境变量
HF_ENDPOINT=https://hf-mirror.com
HF_HOME=/root/autodl-tmp/paul/tools/huggingface
1. 本机安装python 3.10, 并设置软件源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set global.index-url https://mirrors.huaweicloud.com/repository/pypi/simple
2. 安装miniconda
3. 新建一个环境, 并激活
conda create -n quantization python=3.12
2. 本机安装pytorch2.5.1+cuda12.4
pip3 install torch torchvision torchaudio
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
3. clone llamafactory源码
git clone https://github.com/hiyouga/LLaMA-Factory
4. llamafactory本地安装依赖
pip install -e .["vllm","gptq"]
5. 启动webui
6. 在页面中填入相关参数进行操作