jk200201/bird-cot-sft
Viewer • Updated • 5.59k • 41
How to use jk200201/qwen2.5-coder-7b-bird-cot-lora with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-7B-Instruct")
model = PeftModel.from_pretrained(base_model, "jk200201/qwen2.5-coder-7b-bird-cot-lora")LoRA adapter (rank 32) for Qwen/Qwen2.5-Coder-7B-Instruct. It teaches the base model to reason step by step over a database schema and then write SQL, distilled from execution-verified chain-of-thought on BIRD train.
BIRD dev result accuracy: 52.1% greedy, 58.5% with self-consistency (K=8).
Apply the adapter on top of the base with PEFT:
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = "Qwen/Qwen2.5-Coder-7B-Instruct"
tok = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, "jk200201/qwen2.5-coder-7b-bird-cot-lora")
If you want a ready-to-run model, use the merged weights or the GGUF build instead (see below). The prompt format and full results are on the merged model card.
| Artifact | Repo |
|---|---|
| Merged model | jk200201/qwen2.5-coder-7b-bird-cot |
| LoRA adapter (this repo) | jk200201/qwen2.5-coder-7b-bird-cot-lora |
| Training data | jk200201/bird-cot-sft |
Reasoning distillation (CoT-SFT) from a Qwen3-Coder-480B teacher, execution-verified. QLoRA rank 32, alpha 64, 2 epochs, learning rate 2e-4 cosine, max sequence length 8192.