| --- |
| title: Developer Git Commit Agent π€ |
| license: apache-2.0 |
| base_model: Qwen/Qwen2.5-Coder-0.5B-Instruct |
| tags: |
| - code |
| - git |
| - tools |
| - developer-utilities |
| language: |
| - en |
| pipeline_tag: text-generation |
| --- |
| |
| # Developer Git Commit Agent π€ |
|
|
| An specialized, ultra-lightweight AI agent fine-tuned to automatically generate concise, clean, and professional Git commit messages directly from messy code changes (diffs). |
|
|
| Built specifically to optimize workflows for software engineers and developers. |
|
|
| ## π Quickstart: How to Use |
|
|
| You can easily load and run this model locally in your terminal or scripts using the Hugging Face `transformers` library. |
|
|
| ```python |
| from transformers import AutoTokenizer, AutoModelForCausalLM |
| |
| # Load the model directly from the Hub |
| model_id = "YOUR_HF_USERNAME/developer-git-commit-agent" |
| tokenizer = AutoTokenizer.from_pretrained(model_id) |
| model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto") |
| |
| # Paste your messy git diff here |
| git_diff = """ |
| - const port = 3000; |
| + const port = process.env.PORT || 5000; |
| """ |
| |
| # Format prompt using the agent's system instructions |
| messages = [ |
| {"role": "system", "content": "You are an expert software engineer agent. Write a concise, professional Git commit message based on the provided code diff."}, |
| {"role": "user", "content": f"Code Diff:\n{git_diff}"} |
| ] |
| |
| inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to("cuda") |
| outputs = model.generate(inputs, max_new_tokens=60) |
| |
| print(tokenizer.decode(outputs[0], skip_special_tokens=True)) |
| # Output: feat(config): allow dynamic port assignment via environment variables, defaulting to 5000. |
| ``` |
|
|
| ## π Training Details |
| - **Base Model:** Qwen2.5-Coder-0.5B-Instruct |
| - **Dataset:** Maxscha/commitbench (Targeted real-world engineering GitHub commits) |
| - **Method:** Parameter-Efficient Fine-Tuning (LoRA) |
|
|