【LLM】chatGLM-SFT记录

"时间是金"

Posted by 王川 on May 11, 2023

安装记录

安装torch

1
2
3
4
5
6
7
8
9
10
11
# step1 proxy
# 美团跳板机需要首先连接外网
export http_proxy=http://10.22.139.49:6666
export https_proxy=http://10.22.139.49:6666

# step2 install
# torch 1.13.1 cuda11.7
pip install -i http://data-source-pip.sankuai.com/simple --trusted-host data-source-pip.sankuai.com torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117

# torch 2.0
pip install -i http://data-source-pip.sankuai.com/simple --trusted-host data-source-pip.sankuai.com torch==2.0.0+cu118 torchvision==0.15.1+cu117 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118

清华源(需要提前链接外网)

1
2
3
4
5
6
7
8
# 添加proxy 
export http_proxy=http://10.22.139.49:6666
export https_proxy=http://10.22.139.49:6666

#验证
echo $http_proxy

-i https://pypi.tuna.tsinghua.edu.cn/simple

textgen安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
pip install torch # conda install pytorch
git clone https://github.com/shibing624/textgen.git
cd textgen
python setup.py install

# step1
conda create -n chuan python=3.10
or
conda create -p /home/hadoop-mtai/.conda/envs/chuan python=3.10
# step2
export http_proxy=http://10.22.139.49:6666
export https_proxy=http://10.22.139.49:6666

pip install -i http://data-source-pip.sankuai.com/simple --trusted-host data-source-pip.sankuai.com torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117
# step3 安装peft
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple peft
# step4 安装textgen
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple textgen
pip install sentencepiece

peft安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 1.安装accelerate
git clone xxx.accelerate.git

cd accelerate

vi setup.cfg

[easy_install]
index_url = https://pypi.tuna.tsinghua.edu.cn/simple

python setup.py install

# 2.安装peft
git clone xxx.pft.git

cd peft

touch setup.cfg

vi setup.cfg

[easy_install]
index_url = https://pypi.tuna.tsinghua.edu.cn/simple

python setup.py install