Unsloth is a great option for fine-tuning your LLM models, but setting it up can be confusing.

Here, I’ll be covering common issues

1. Dependency conflicts

Between Pytorch, Pyarrow and other dependencies I had some trouble getting them all to play nice, so here’s my requirements.txt

requirements.txt

2. Default python versions

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1

3. Trouble saving model due to llama-cpp errors

cd llama.cpp
git checkout b3345
git submodule update --init --recursive
make clean
make all -j
git log -1

4. Missing pip (for some reason)

curl <https://bootstrap.pypa.io/get-pip.py> -o get-pip.py
python get-pip.py

A sample notebook to get you started

Ollama_+Unsloth+Llama_3+_CSV_finetuning.ipynb