Teaching Small LLMs to Write Git Commits
Collection
Dataset + LoRA adapters for fine-tuning small LLMs to write Conventional Commits from a git diff. Part of a local, offline commit-message tool. โข 7 items โข Updated
How to use Elib27/qwen2.5-coder-1.5b-commit-msg-lora with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen2.5-Coder-1.5B-Instruct")
model = PeftModel.from_pretrained(base_model, "Elib27/qwen2.5-coder-1.5b-commit-msg-lora")LoRA adapter fine-tuned on top of Qwen/Qwen2.5-Coder-1.5B-Instruct
to generate Conventional Commits messages from a git diff.
Part of a project to build a local, offline prepare-commit-msg git hook.
Full write-up: https://eliotbas.com/projects/commits-fine-tuning/
Training dataset: https://huggingface.co/datasets/Elib27/commits
See the article for full evaluation results (ROUGE-L, structural checks, LLM-as-judge) across all model sizes.
Base model
Qwen/Qwen2.5-1.5B