Downloads · 30 days
12
4% of all-time downloads
RinnRinnmini/lora_structeval_t_qwen3_4b_sft_v3
lora_structeval_t_qwen3_4b_sft_v3 is a text generation model from RinnRinnmini. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
This repository provides a LoRA adapter (PEFT) fine-tuned from Qwen/Qwen3-4B-Instruct-2507 for structured output tasks (StructEval-T style).
Downloads · 30 days
12
4% of all-time downloads
All-time downloads
268
Public
Repo size
540 MB
Likes
0
Public
Click a slice to open those files.
.safetensors529 MB · 97%
From the Hugging Face model README
This repository provides a LoRA adapter (PEFT) fine-tuned from Qwen/Qwen3-4B-Instruct-2507 for structured output tasks (StructEval-T style).
Important: This repo contains LoRA adapter weights only. Load the base model separately, then apply this adapter.
Improve structured output accuracy and stability for formats such as JSON / YAML / XML / TOML / CSV.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_id = "Qwen/Qwen3-4B-Instruct-2507"
adapter_id = "RinnRinnmini/lora_structeval_t_qwen3_4b_sft_v3"
tokenizer = AutoTokenizer.from_pretrained(base_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
base_id,
device_map="auto",
torch_dtype=torch.float16,
trust_remote_code=True,
)
model = PeftModel.from_pretrained(model, adapter_id)
model.eval()
prompt = "Convert this JSON to YAML. Return ONLY YAML.\n\nJSON:\n{\"a\": 1, \"b\": [2,3]}"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(out[0], skip_special_tokens=True))