Team Ai
Modelpublic

rahilfahim/code-reviewer-lora

sourceHugging Facemitupdated 17d agoView on Hugging Face
0likes39downloads
Model Card

Code Reviewer LoRA โ€” Llama 3.2 3B

A LoRA adapter fine-tuned with QLoRA on Llama 3.2 3B Instruct to review Python code with severity levels (Critical, Warning, Info).

๐Ÿ“Š Training Summary

MetricValue
Base modelLlama 3.2 3B Instruct
MethodQLoRA (rank 16, alpha 16)
Training examples500
Training time2.5 min (Colab T4)
Final loss0.11
Adapter size88 MB

๐Ÿš€ Usage

python
from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="unsloth/Llama-3.2-3B-Instruct-bnb-4bit",
    max_seq_length=2048,
    load_in_4bit=True,
)
model.load_adapter("rahilfahim/code-reviewer-lora")
FastLanguageModel.for_inference(model)

prompt = """### Instruction:
You are a Python code reviewer. Review the following code and identify bugs, style issues, and improvements.

### Input:
def add(a,b): return a+b

### Response:
"""

inputs = tokenizer([prompt], return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.3)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True)[0])

๐Ÿ“ฆ Links

๐Ÿ™ Acknowledgments

Trained using Unsloth on Google Colab.