# ccs-code-llama-7b
ccs-code-llama-7b is a model based on code-llama-7b, fine-tuned using LORA SFT, which can automatically classify a git commit into ten [conventional commits types](https://www.conventionalcommits.org/en/v1.0.0/), e.g., feat, fix, build, docs, ci, ...
See our [GitHub Repo](https://github.com/0x404/conventional-commit-classification) for more details.
## How to Use
Our model basically accepts two inputs: the commit message and the corresponding git diff. To classify your desired commit, you must follow a specific prompt format. We provide a code snippet as follows:
```python
from transformers import pipeline
pipe = pipeline("text-generation", model="0x404/ccs-code-llama-7b", device_map="auto")
tokenizer = pipe.tokenizer
def prepare_prompt(commit_message: str, git_diff: str, context_window: int = 1024):
prompt_head = "<s>[INST] <<SYS>>\nYou are a commit classifier based on commit message and code diff.Please classify the given commit into one of the ten cat…