u-10bei/structured_data_with_cot_dataset_512_v2
Viewer • Updated • 3.93k • 146 • 1
How to use hamini58/qwen3-4b-structeval-lora with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("unsloth/qwen3-4b-instruct-2507-unsloth-bnb-4bit")
model = PeftModel.from_pretrained(base_model, "hamini58/qwen3-4b-structeval-lora")This repository provides a LoRA adapter fine-tuned from
Qwen/Qwen3-4B-Instruct-2507 for improving structured output accuracy.
⚠️ This repository contains LoRA adapter weights only.
The base model must be downloaded separately.
This LoRA adapter is trained to improve the model’s ability to generate strictly structured outputs, such as:
During training:
Output: marker is supervisedThis design improves format correctness without exposing or overfitting internal reasoning traces.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model = "Qwen/Qwen3-4B-Instruct-2507"
adapter_model = "hamini58/qwen3-4b-structeval-lora"
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(
base_model,
torch_dtype=torch.float16,
device_map="auto",
)
model = PeftModel.from_pretrained(model, adapter_model)
model.eval()
Training dataset:
u-10bei/structured_data_with_cot_dataset_512_v2
Dataset License:
MIT License
Compliance:
Users must comply with:
This repository distributes only LoRA adapter weights and does not redistribute the base model.
Base model
Qwen/Qwen3-4B-Instruct-2507