Downloads · 30 days
35
100% of all-time downloads
rahilfahim/code-reviewer-lora
code-reviewer-lora is a text generation model from rahilfahim. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as mit.
A LoRA adapter fine-tuned with QLoRA on Llama 3.2 3B Instruct to review Python code with severity levels (Critical, Warning, Info).
Downloads · 30 days
35
100% of all-time downloads
All-time downloads
35
Public
Repo size
212 MB
Likes
0
Public
Click a slice to open those files.
.safetensors97.3 MB · 85%
From the Hugging Face model README
A LoRA adapter fine-tuned with QLoRA on Llama 3.2 3B Instruct to review Python code with severity levels (Critical, Warning, Info).
| Metric | Value |
|---|---|
| Base model | Llama 3.2 3B Instruct |
| Method | QLoRA (rank 16, alpha 16) |
| Training examples | 500 |
| Training time | 2.5 min (Colab T4) |
| Final loss | 0.11 |
| Adapter size | 88 MB |
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])
Trained using Unsloth on Google Colab.