Train Your Own LLM - companion code
Chapter 9: Doing More with Less: LoRA and QLoRA

HOW TO RUN
Use the Python environment from Chapter 4 (Python 3.12 or 3.13,
versions pinned in Appendix F). Unzip this folder, cd into it, and run each
script with: python <script>.py   (each example's caption in the book
gives its file name). Expected output is printed in the book.
Scripts download models and datasets from the Hugging Face Hub on first run.

CHAPTER NOTES
ch09_merge.py loads the adapter saved by ch09_lora.py (runs/ch09-lora/adapter).

FILES THAT NEED A GPU
- ch09_qlora_gpu.py (Example 9.5: one 24 GB NVIDIA GPU plus bitsandbytes)

FILES
- ch09_count.py
- ch09_lora.py
- ch09_lora_by_hand.py
- ch09_lora_diag.py
- ch09_merge.py
- ch09_new_tokens.py
- ch09_qlora_gpu.py
- shop_style_train.jsonl
- shop_style_test.jsonl

LICENSE
The code is released under the MIT License (see LICENSE).
Data files that scripts download keep their own licenses.
