极致简化,快速部署。

<aside> 💡 你应该至少用我的其它笔记本的方式装过一次

</aside>

<aside> 💡 你应该能大概了解代码的意思

</aside>

<aside> 💡 你应该没有删除share文件夹中下载的文件,并且准备好了也知道怎么用wget或其他方式下载缺少的文件

</aside>

常规版 cookie版 数据集版

1.conda相关

conda config --add channels <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free>
conda config --add channels <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge>
conda config --add channels <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda>
conda config --set show_channel_urls yes
conda create -n db python=3.10

conda activate db

2.环境安装

cd ~/share
sudo sh cuda_11.0.3_450.51.06_linux.run --librarypath=/usr/local/cuda-11.0

ln -snf /usr/local/cuda-11.0 /usr/local/cuda
ln -snf /usr/local/cuda-11.0 /usr/local/nvidia
cp ~/share/bashrc ~/.bashrc
conda env config vars set LD_LIBRARY_PATH=/root/.local/conda/envs/db/lib -n db
conda deactivate
conda activate db

2.6安装tensorflow-gpu等

cd ~/share
conda install --use-local cudatoolkit-11.0.3-h88f8997_10.tar.bz2
conda install --use-local cudnn-8.4.1.50-hed8a83a_0.tar.bz2
conda install --use-local nccl-2.14.3.1-h17a0586_0.tar.bz2
conda install --use-local tensorflow-base-2.8.1-cuda110py310h9e8cd52_0.tar.bz2
conda install tensorflow-gpu=2.8.1=cuda110py310h5b0ac8e_0

3.安装支持

pip

pip config set global.index-url <https://pypi.tuna.tsinghua.edu.cn/simple>
pip install diffusers
pip install torch-1.7.1+cu110-cp37-cp37m-linux_x86_64.whl
pip install torchvision-0.8.2+cu110-cp37-cp37m-linux_x86_64.whl
pip install accelerate==0.12.0 torchaudio==0.7.2 transformers ftfy bitsandbytes gradio omegaconf einops pytorch_lightning=1.7.7 pynvml
pip install xformers-0.0.14.dev0-cp310-cp310-linux_x86_64.whl

accelerate

#应用备份
cp ~/default_config.yaml ~/.cache/huggingface/accelerate/default_config.yaml 

5.内核