创建 conda 环境
- 安装 anaconda 或 miniconda (linux)
1 | # 下载 |
- 创建虚拟环境
1 | conda create -n train python=3.9 # 名字train + python 版本3.9 |
- 激活虚拟环境
1 | conda activate train # 激活虚拟环境 |
- 设置 pip 路径 (若发现无法直接使用pip,将软件安装如虚拟环境中请输入如下代码)
1 | alias pip='虚拟环境的位置/bin/pip' |
- 安装 torch
1 | pip install torch==2.3.0+cu121 -f https://download.pytorch.org/whl/torch_stable.html |
- 配置需要的包
1 | wget -O requirements.txt https://www.pan.hekaiyu.com.cn/d/file/python/env/requirements.txt?sign=SmPNzV5IjN2sZL9p4iDz675aiVM7M4ASiB7JNoq2ceo=:0 |
- 预先下载好的包
1 | # flash attention——link: https://github.com/Dao-AILab/flash-attention/releases |
Github使用指南(待修改)
- 将 Git 与 Github 绑定
- 获取 ssh key
1 | cd ~/.ssh |
- 若返回 “no such file or directory” 表明电脑没有ssh key,创建ssh key
1 | ssh-keygen -t rsa -C “git账号邮箱” |
- 在 .shh 目录下获取 id_rsa.pub 文件里面存储的是公钥并绑定到到自己的 GitHub 上

- 在 Git bash 中,输入:
1 | ssh -T git@github.com |
检查是否绑定成功
- 配置绑定信息
1 | git config --global user.name “gitname” |
- 提交代码
1 | cd /path/to/your/project # 进入本地项目目录 |
- 拉取项目
1 | git pull origin main |
- 获取 github 项目的代码
1 | git clone https://github.com/Kaiyu-He/env.git |