历时12个小时的调试,终于把流程完整跑通。
本教程通过AutoDL云平台部署,微调大模型,手把手带你感受微调,采用云平台的学术加速,可以下载github和huggingface的代码、模型、数据集
一、ChatGLM-6B介绍
智谱清言的开源双语对话语言模型
chat地址:https://chatglm.cn/main/alltoolsdetail?lang=zh
代码地址:https://github.com/THUDM/ChatGLM-6B
二、创建实例
2.1 租借实例
打开AutoDL,租借显存24G的3090或4090,原来我用的python3.12的问题很多,就换到3.10
三、准备数据
3.1 复制学术加速代码
source /etc/network_turbo
3.2 下载代码仓
进入数据盘,设置学术加速,下载代码仓库
cd autodl-tmp/
source /etc/network_turbo
git clone https://github.com/THUDM/ChatGLM-6B.git
3.3 下载ChatGLM-6B模型
3.3.1 安装git-lfs
Hugging Face 使用 Git LFS 来管理大文件(如模型权重、数据集等),而 Git LFS 会用这种指针文件代替真实文件,以节省 Git 仓库的空间。安装lfs可以下载真实文件
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
git lfs install
3.3.2 下载权重文件
训练的时候会下载一份到roo