How to use from
llama.cpp
Install from brew
brew install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf CyrusCheungkf/git-commit-3B
# Run inference directly in the terminal:
llama-cli -hf CyrusCheungkf/git-commit-3B
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf CyrusCheungkf/git-commit-3B
# Run inference directly in the terminal:
llama-cli -hf CyrusCheungkf/git-commit-3B
Use pre-built binary
# Download pre-built binary from:
# https://github.com/ggerganov/llama.cpp/releases
# Start a local OpenAI-compatible server with a web UI:
./llama-server -hf CyrusCheungkf/git-commit-3B
# Run inference directly in the terminal:
./llama-cli -hf CyrusCheungkf/git-commit-3B
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-server llama-cli
# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama-server -hf CyrusCheungkf/git-commit-3B
# Run inference directly in the terminal:
./build/bin/llama-cli -hf CyrusCheungkf/git-commit-3B
Use Docker
docker model run hf.co/CyrusCheungkf/git-commit-3B
Quick Links

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
84
Safetensors
Model size
3B 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
(98)
this model
Quantizations
1 model

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