Text Generation
PEFT
Safetensors
English
code-review
lora
qlora
unsloth
llama-3.2
python
conversational
Instructions to use rahilfahim/code-reviewer-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use rahilfahim/code-reviewer-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Llama-3.2-3B-Instruct-bnb-4bit") model = PeftModel.from_pretrained(base_model, "rahilfahim/code-reviewer-lora") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
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
| 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 |
π Usage
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
- Full project: GitHub Repo
- Live demo: HF Space
- Benchmark: docs/benchmark_results.json
π Acknowledgments
Trained using Unsloth on Google Colab.
- Downloads last month
- 24
Model tree for rahilfahim/code-reviewer-lora
Base model
meta-llama/Llama-3.2-3B-Instruct Quantized
unsloth/Llama-3.2-3B-Instruct-bnb-4bit