代码拉取完成,页面将自动刷新
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
pip install uv
uv venv
source .venv/bin/activate
export UV_HTTP_TIMEOUT=300
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。