Instructions to use sharad31/commit-msg-qwen-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use sharad31/commit-msg-qwen-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/qwen2.5-coder-1.5b-instruct-bnb-4bit") model = PeftModel.from_pretrained(base_model, "sharad31/commit-msg-qwen-lora") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use sharad31/commit-msg-qwen-lora with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sharad31/commit-msg-qwen-lora to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sharad31/commit-msg-qwen-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for sharad31/commit-msg-qwen-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="sharad31/commit-msg-qwen-lora", max_seq_length=2048, )
| base_model: unsloth/Qwen2.5-Coder-1.5B-Instruct | |
| library_name: peft | |
| tags: | |
| - lora | |
| - sft | |
| - unsloth | |
| - code | |
| - git | |
| - commit-message-generation | |
| license: apache-2.0 | |
| # commit-msg-qwen-lora | |
| A LoRA adapter fine-tuned on top of [Qwen2.5-Coder-1.5B-Instruct](https://huggingface.co/unsloth/Qwen2.5-Coder-1.5B-Instruct) to generate concise, conventional-style Git commit messages from staged diffs. | |
| ## Training Details | |
| - **Base model:** Qwen2.5-Coder-1.5B-Instruct | |
| - **Method:** QLoRA (LoRA rank 16) via Unsloth on Google Colab T4 GPU | |
| - **Dataset:** 2,397 real (diff, commit message) pairs extracted and cleaned from personal GitHub repositories | |
| - **Train / Val / Test split:** 1919 / 239 / 239 | |
| - **Epochs:** 3 | **Batch size:** 8 (effective) | **Learning rate:** 2e-4 | |
| - **Training loss:** 1.03 → 0.88 | |
| ## Usage | |
| ```python | |
| from peft import PeftModel | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| base = AutoModelForCausalLM.from_pretrained("unsloth/Qwen2.5-Coder-1.5B-Instruct") | |
| model = PeftModel.from_pretrained(base, "sharad31/commit-msg-qwen-lora") | |
| tokenizer = AutoTokenizer.from_pretrained("sharad31/commit-msg-qwen-lora") | |
| diff = """diff --git a/src/auth.ts b/src/auth.ts | |
| + if (!user || !pass) throw new Error('Missing credentials'); | |
| """ | |
| messages = [ | |
| {"role": "system", "content": "You are a precise commit message generator. Given a git diff, write a concise, conventional-style commit message."}, | |
| {"role": "user", "content": f"Diff:\n```\n{diff}\n```"}, | |
| ] | |
| inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True) | |
| outputs = model.generate(inputs, max_new_tokens=64, temperature=0.3) | |
| print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)) | |
| ``` |