Downloads · 30 days
20
24% of all-time downloads
irfanalee/code-review-critic-py
code-review-critic-py is a text generation model from irfanalee. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
A fine-tuned Qwen2.5-Coder-7B-Instruct model for Python code review.
Downloads · 30 days
20
24% of all-time downloads
All-time downloads
82
Public
Parameters
7.6B
15.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors15.2 GB · 100%
From the Hugging Face model README
A fine-tuned Qwen2.5-Coder-7B-Instruct model for Python code review.
This model provides constructive, actionable feedback on Python code. It focuses on:
Base Model: Qwen/Qwen2.5-Coder-7B-Instruct Fine-tuning Method: QLoRA (4-bit quantization + LoRA adapters) Training Data: 8,275 real GitHub PR review comments from major Python projects
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("YOUR_USERNAME/code-review-critic")
tokenizer = AutoTokenizer.from_pretrained("YOUR_USERNAME/code-review-critic")
messages = [
{"role": "system", "content": "You are an expert code reviewer. Analyze the provided Python code and give constructive, specific feedback."},
{"role": "user", "content": "Review this Python code:\n\n```python\ndef get_user(id):\n return db.query(f'SELECT * FROM users WHERE id = {id}')\n```"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))