Downloads · 30 days
3
4% of all-time downloads
takenoko888/Qwen3-4B-DPO-Merged
Qwen3-4B-DPO-Merged is a text generation model from takenoko888. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of Qwen/Qwen3-4B-Instruct using Direct Preference Optimization (DPO) via the Unsloth library. The model has been merged (16-bit), so you can use it directly with the transformers lib…
Downloads · 30 days
3
4% of all-time downloads
All-time downloads
69
Public
Parameters
4B
8.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of Qwen/Qwen3-4B-Instruct using Direct Preference Optimization (DPO) via the Unsloth library.
The model has been merged (16-bit), so you can use it directly with the transformers library without additional adapters.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "takenoko888/Qwen3-4B-DPO-Merged"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
prompt = "思考の連鎖を使って、次の問題を解いてください。\nリンゴが3個あります..."
messages = [{"role": "user", "content": prompt}]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt"
).to("cuda")
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))