更新日志:
2024-12-18: dockerpull.org/kevinchina/deeplearning:llamafactory20241218-2 2025-03-10:kevinchina/deeplearning:llamafactory20250311-3 额外安装: pip install opencv-python-headless==4.5.4.58 pip install transformers==4.49.0 训练qwen2.5 vl 没问题 2025-04-18:kevinchina/deeplearning:llamafactory20250418 # cuda12.6 嫌麻烦没安装其他库
保持最新的仓库代码:
bashgit clone https://github.com/hiyouga/LLaMA-Factory.git --depth 1
cd LLaMA-Factory
如果不在意本地文件的修改,可以通过以下命令直接获取远端最新的文件:
bashgit fetch --all git reset --hard origin/main
构建镜像:
bashdocker build --progress=plain -f ./docker/docker-cuda/Dockerfile \
--network=host --build-arg http_proxy=http://0.0.0.0:10828 --build-arg https_proxy=http://0.0.0.0:10828 \
--build-arg INSTALL_BNB=false \
--build-arg INSTALL_VLLM=true \
--build-arg INSTALL_DEEPSPEED=true \
--build-arg INSTALL_FLASHATTN=false \
--build-arg PIP_INDEX=https://pypi.org/simple \
-t kevinchina/deeplearning:llamafactory20250418 .
# 或者
docker build --progress=plain -f ./docker/docker-cuda/Dockerfile \
--network=host \
--build-arg INSTALL_BNB=false \
--build-arg INSTALL_VLLM=true \
--build-arg INSTALL_DEEPSPEED=true \
--build-arg INSTALL_FLASHATTN=false \
--build-arg PIP_INDEX=https://pypi.org/simple \
-t kevinchina/deeplearning:llamafactory20250418 .
安装 AutoGPTQ:https://www.dong-blog.fun/post/1737#1.%20%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87
在容器里:
bashecho 'export TORCH_CUDA_ARCH_LIST="7.2;8.0;8.6;8.7;9.0+PTX"' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/PanQiWei/AutoGPTQ.git && cd AutoGPTQ
pip install .
安装Hugging Face Optimum 库:
bashpython -m pip install git+https://github.com/huggingface/optimum.git
bashdocker push kevinchina/deeplearning:llamafactory20250418-1
运行容器方法例子:
bashcd /root/xiedong/LLaMA-Factory
docker run -it --rm --gpus=all \
--net host \
--shm-size 16G \
kevinchina/deeplearning:llamafactory20250311-3 bash
docker run -it --rm --gpus=all \ --net host \ --shm-size 16G \ kevinchina/deeplearning:llamafactory20250311-3 bash cd / && git clone https://github.com/hiyouga/LLaMA-Factory.git --depth 1 rsync -av /LLaMA-Factory/ /app/ # 同步不一样的文件到app cd /app pip install -e . llamafactory-cli webui docker commit 2a8002c84a97 kevinchina/deeplearning:llamafactory20250419-1
本文作者:Dong
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC。本作品采用《知识共享署名-非商业性使用 4.0 国际许可协议》进行许可。您可以在非商业用途下自由转载和修改,但必须注明出处并提供原作者链接。 许可协议。转载请注明出处!