1 Star 0 Fork 0

spader.ai/spader-ai-hands-on

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
install-libs.md 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
spader-ai-007 提交于 2个月前 . minor update

Set up the environment for running the training

  • You need to run the following commands by yourself on terminal

set global pip proxy and hf endpoint mirror

mkdir -p ~/.pip && echo -e '[global]\nindex-url = https://pypi.tuna.tsinghua.edu.cn/simple\ntrusted-host = pypi.tuna.tsinghua.edu.cn' >> ~/.pip/pip.conf

echo -e 'export HF_ENDPOINT="https://hf-mirror.com"' >> ~/.bashrc && source ~/.bashrc

install uv

pip install uv
uv venv
source .venv/bin/activate
export UV_HTTP_TIMEOUT=300

install libs

DO NOT use the following way to install flash attention since it is too slow in China

uv pip install flash-attn --no-build-isolation

Instead, we can use the precompiled wheel file flash_attn-2.7.4.post1+cu12torch2.2cxx11abiFALSE-cp310-cp310-linux_x86_64.whl from Github which contains key info as follows. Download the corresponding file for your environment.

      cu12:CUDA 12.x
      torch2.2:PyTorch 2.2
      cp310:Python 3.10 
      FALSE: PyTorch C++ ABI status
             you can check it by 
             import torch; print(torch._C._GLIBCXX_USE_CXX11_ABI)

Then run the following command:

uv pip install libs/flash_attn-2.7.4.post1+cu12torch2.4cxx11abiFALSE-cp311-cp311-linux_x86_64.whl

Finally, install the libs specified in the requirements file

uv pip install -r requirements.txt 
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/spader-ai/spader-ai-hands-on.git
git@gitee.com:spader-ai/spader-ai-hands-on.git
spader-ai
spader-ai-hands-on
spader-ai-hands-on
main

搜索帮助