This repository contains a Docker-based environment for fine-tuning the Mistral Small 24B Instruct model using Unsloth, any model can be trained on the environment, Mistral happens to be as an example.
The image is hosted on Docker Hub You can run the container in different modes:
docker run -it --gpus all \
-v $HOME/.cache/huggingface:/root/.cache/huggingface \
shivamb25/unsloth-dev
docker run -it --gpus all \
-p 8888:8888 \
-v $HOME/.cache/huggingface:/root/.cache/huggingface \
-e ENABLE_JUPYTER=true \
shivamb25/unsloth-dev
docker run -it --gpus all \
-p 8888:8888 \
-v $HOME/.cache/huggingface:/root/.cache/huggingface \
-e ENABLE_JUPYTER=true \
-e USE_JUPYTERLAB=true \
shivamb25/unsloth-dev
When enabled with the ENABLE_JUPYTER=true option, the container starts a Jupyter server on port 8888. You can also specify USE_JUPYTERLAB=true to start JupyterLab instead of the traditional Notebook.
You can access either interface by navigating to:
http://localhost:8888
Jupyter provides an interactive environment for running and modifying the fine-tuning script. JupyterLab offers a more integrated development experience with a file browser, multiple tabs, and extensions.
The Hugging Face cache stores downloaded models, tokenizers, and other assets locally. Mounting this cache directory has several benefits:
$HOME/.cache/huggingface//root/.cache/huggingface/For more granular control, you can mount specific cache subdirectories:
docker run -it --gpus all \
-v $HOME/.cache/huggingface/hub:/root/.cache/huggingface/hub \ # Model weights and files
-v $HOME/.cache/huggingface/datasets:/root/.cache/huggingface/datasets \ # Dataset cache
-v $HOME/.cache/huggingface/accelerate:/root/.cache/huggingface/accelerate \ # Accelerate configs
shivamb25/unsloth-dev
Do you need to install Flash Attention? Run these commands in your container:
apt-get update; apt-get install -y cuda-nvcc-12-4; rm -rf /var/lib/apt/lists/*
pip install flash-attn --no-build-isolation
Content type
Image
Digest
sha256:441b0516a…
Size
4.7 GB
Last updated
11 months ago
docker pull shivamb25/unsloth-dev