Downloads · 30 days
0
Swarnimm22HF/ai-code-review-tinyllama
ai-code-review-tinyllama is a machine learning model from Swarnimm22HF. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Fine-tuned version of TinyLlama 1.1B for automated Python code review, trained on CodeSearchNet using LoRA adapters.
Downloads · 30 days
0
Access
Public
Updated Mar 6, 2026
Repo size
50.5 MB
Likes
0
Public
Click a slice to open those files.
.safetensors50.5 MB · 93%
From the Hugging Face model README
Fine-tuned version of TinyLlama 1.1B for automated Python code review, trained on CodeSearchNet using LoRA adapters.
| Metric | Base Model | Fine-Tuned |
|---|---|---|
| ROUGE-L | 0.1541 | 0.5573 (+261%) |
| BERTScore F1 | 0.8226 | 0.9265 (+12.6%) |
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model = AutoModelForCausalLM.from_pretrained(
"TinyLlama/TinyLlama-1.1B-Chat-v1.0",
torch_dtype=torch.float32
)
model = PeftModel.from_pretrained(
base_model,
"Swarnimm22HF/ai-code-review-tinyllama"
)
tokenizer = AutoTokenizer.from_pretrained(
"TinyLlama/TinyLlama-1.1B-Chat-v1.0"
)
prompt = """### Instruction:
Review the following Python function.
### Code:
```python
def divide(a, b):
return a / b
```
### Response:"""
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
GitHub: AI Code Review Assistant