更新日志:
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
保持最新的仓库代码:
bashgit clone https://github.com/hiyouga/LLaMA-Factory.git
cd /root/xiedong/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.1:0 --build-arg https_proxy=http://0.0.0.0:7890 \
--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:llamafactory20241026 .
# 或者
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:llamafactory20250311 .
安装 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;7.5;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:llamafactory20241027
运行容器方法例子:
bashcd /root/xiedong/LLaMA-Factory
docker run -dit --rm --gpus=all \
-v ./hf_cache:/root/.cache/huggingface \
-v ./ms_cache:/root/.cache/modelscope \
-v ./data:/app/data \
-v ./output:/app/output \
-v ./examples:/app/examples \
-v /root/xiedong/:/xiedong/ \
-p 7861:7860 \
-p 8001:8000 \
--shm-size 16G \
--name llamafactory4 \
kevinchina/deeplearning:llamafactory20241027
本文作者:Dong
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC。本作品采用《知识共享署名-非商业性使用 4.0 国际许可协议》进行许可。您可以在非商业用途下自由转载和修改,但必须注明出处并提供原作者链接。 许可协议。转载请注明出处!