nivethitha1703/developer-git-commit-agent
1560
1---2title: Developer Git Commit Agent ๐ค3license: apache-2.04base_model: Qwen/Qwen2.5-Coder-0.5B-Instruct5tags:6- code7- git8- tools9- developer-utilities10language:11- en12pipeline_tag: text-generation13---14 15# Developer Git Commit Agent ๐ค16 17An specialized, ultra-lightweight AI agent fine-tuned to automatically generate concise, clean, and professional Git commit messages directly from messy code changes (diffs). 18 19Built specifically to optimize workflows for software engineers and developers.20 21## ๐ Quickstart: How to Use22 23You can easily load and run this model locally in your terminal or scripts using the Hugging Face `transformers` library.24 25```python26from transformers import AutoTokenizer, AutoModelForCausalLM27 28# Load the model directly from the Hub29model_id = "YOUR_HF_USERNAME/developer-git-commit-agent"30tokenizer = AutoTokenizer.from_pretrained(model_id)31model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")32 33# Paste your messy git diff here34git_diff = """35- const port = 3000;36+ const port = process.env.PORT || 5000;37"""38 39# Format prompt using the agent's system instructions40messages = [41 {"role": "system", "content": "You are an expert software engineer agent. Write a concise, professional Git commit message based on the provided code diff."},42 {"role": "user", "content": f"Code Diff:\n{git_diff}"}43]44 45inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to("cuda")46outputs = model.generate(inputs, max_new_tokens=60)47 48print(tokenizer.decode(outputs[0], skip_special_tokens=True))49# Output: feat(config): allow dynamic port assignment via environment variables, defaulting to 5000.50```51 52## ๐ Training Details53- **Base Model:** Qwen2.5-Coder-0.5B-Instruct54- **Dataset:** Maxscha/commitbench (Targeted real-world engineering GitHub commits)55- **Method:** Parameter-Efficient Fine-Tuning (LoRA)56 