u-10bei/dpo-dataset-qwen-cot
Viewer • Updated • 4.04k • 117 • 2
How to use DLNorb/dpo_lora_model_stage3 with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("~/workspace/2025_llm_comp_main/output/dpo_lora_model_stage1_merged_base")
model = PeftModel.from_pretrained(base_model, "DLNorb/dpo_lora_model_stage3")This repository provides a DPO LoRA adapter fine-tuned from Qwen/Qwen3-4B-Instruct-2507 using QLoRA (4-bit, Unsloth).
The DPO adapter was trained on top of the SFT Stage 3 adapter (DLNorb/lora_structeval_t_qwen3_4b_v2_stage3).
This repository contains LoRA adapter weights only. The base model and SFT adapter must be loaded separately.
This adapter applies Direct Preference Optimization (DPO) to improve structured output accuracy (JSON / YAML / XML / TOML / CSV) by aligning the model with human preferences.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base = "Qwen/Qwen3-4B-Instruct-2507"
adapter = "DLNorb/dpo_lora_model_stage3"
tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(
base,
torch_dtype=torch.float16,
device_map="auto",
)
model = PeftModel.from_pretrained(model, adapter)
Training data:
Compliance: Users must comply with each dataset's license (including copyright notice) and the base model's original terms of use.
Base model
Qwen/Qwen3-4B-Instruct-2507