Model Card for Model ID

Fine tuned Qwen2.5 3B model for writing git commit message. Used dataset Maxscha/commitbench

Model Details

  • Developed by: Cyrus Cheung
  • Model type: Qwen2.5 3B
  • License: qwen-research
  • Finetuned from model: Qwen/Qwen2.5-Coder-3B-Instruct

Uses

from transformers.models.auto.modeling_auto import AutoModelForCausalLM
from transformers.models.auto.tokenization_auto import AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("CyrusCheungkf/git-commit-3B")
tokenizer = AutoTokenizer.from_pretrained("CyrusCheungkf/git-commit-3B")
git_diff = "Output from using 'git diff'"

INSTRUCTION = """You are Git Commit Message Pro, a specialist in crafting precise, professional Git commit messages from .diff files. Your role is to analyze these files, interpret the changes, and generate a clear, direct commit message.

Guidelines:
1. Be specific about the type of change (e.g., "Rename variable X to Y", "Extract method Z from class W").
2. Prefer to write it on why and how instead of what changed.
3. Interpret the changes; do not transcribe the diff.
4. If you cannot read the entire file, attempt to generate a message based on the available information.
5. Be concise and summarize the most important changes. Keep your response in 1 sentence."""
conversation = [
  {"role": "user", "content": INSTRUCTION + "\n\nInputs:\n" + git_diff},
]
tokens = tokenizer.apply_chat_template(
  conversation, add_generation_prompt=True, return_tensors="pt", return_dict=True
)
output = model.generate(
  inputs=tokens["input_ids"],
  attention_mask=tokens["attention_mask"],
)
print(output)
Downloads last month
72
Safetensors
Model size
3.09B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for CyrusCheungkf/git-commit-3B

Base model

Qwen/Qwen2.5-3B
Quantized
(80)
this model
Quantizations
1 model

Dataset used to train CyrusCheungkf/git-commit-3B