Code Autopsy

Model Description

Code Autopsy is a QLoRA adapter fine-tuned on top of Qwen2.5-Coder-7B-Instruct for automated code review. It analyzes code for bugs, security vulnerabilities, style issues, and best practice violations — providing detailed, actionable review comments similar to a senior engineer's review.

Model Architecture

  • Base Model: Qwen/Qwen2.5-Coder-7B-Instruct
  • Fine-tuning Method: QLoRA (Quantized Low-Rank Adaptation) via PEFT
  • Checkpoint: checkpoint-809 (best checkpoint)
  • Task: Code Review / Code Analysis

Training Details

  • Framework: HuggingFace PEFT + Transformers + BitsAndBytes
  • Training Steps: 809 (best checkpoint selected)
  • Dataset: Curated code review dataset with paired code + review comment examples
  • Quantization: 4-bit NF4 quantization during training

Files

File Description
adapter_model.safetensors LoRA adapter weights
adapter_config.json PEFT adapter configuration
tokenizer.json Tokenizer vocabulary
tokenizer_config.json Tokenizer configuration

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
import torch
from huggingface_hub import snapshot_download

# Download adapter
adapter_dir = snapshot_download(repo_id='devanshty/Code-Autopsy')

# Load base model with 4-bit quantization
bnb_config = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.float16)
base_model = AutoModelForCausalLM.from_pretrained(
    "Qwen/Qwen2.5-Coder-7B-Instruct",
    quantization_config=bnb_config,
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(adapter_dir)

# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, adapter_dir)
model.eval()

# Review code
code = 
Downloads last month
32
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for devanshty/Code-Autopsy

Base model

Qwen/Qwen2.5-7B
Adapter
(675)
this model