Views
No views yet
adapter_model.safetensors — final DPO LoRA weights (1.2 GB, r=64)adapter_config.json — PEFT configchat_template.jinja + tokenizer files — for inference1import torch
2from peft import PeftModel
3from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
4
5bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
6 bnb_4bit_compute_dtype=torch.bfloat16, bnb_4bit_use_double_quant=True)
7tok = AutoTokenizer.from_pretrained("Qwen/Qwen3.6-27B", trust_remote_code=True)
8model = AutoModelForCausalLM.from_pretrained(
9 "Qwen/Qwen3.6-27B", quantization_config=bnb, device_map="auto",
10 trust_remote_code=True, attn_implementation="eager",
11)
12model = PeftModel.from_pretrained(model, "jimhuang0731/qwen36-27b-v7-dpo-china-mcq")| Stage | Setting | Value |
|---|---|---|
| SFT | LoRA r / α / dropout | 64 / 128 / 0.05 |
| SFT | target_modules | q,k,v,o + gate,up,down (MLP) |
| SFT | lr / scheduler | 2e-5 / cosine, warmup 0.05 |
| SFT | epochs / batch / accum | 2 (ep1 best) / 1 / 8 |
| DPO | lr / β | 5e-6 / 0.2 |
| DPO | epochs | 1 |
| Infer | vote × TTP perm | 5 × 4 = 20 samples/Q |
| Infer | RAG retrieve / rerank | top-10 → top-3 |
| Infer | temperature / top_p | 0.6 / 0.95 |