Downloads · 30 days
7
11% of all-time downloads
Daksh1/qwen3-4b-dpo-ckpt-2
qwen3-4b-dpo-ckpt-2 is a text generation model from Daksh1. Use it when you need the model to write or continue text. It is set up for transformers.
This model is checkpoint 2 of 4 from DPO (Direct Preference Optimization) fine-tuning of Qwen/Qwen3-4B-Base.
Downloads · 30 days
7
11% of all-time downloads
All-time downloads
65
Public
Parameters
4B
8.8 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8.8 GB · 100%
How the weights are stored.
BF163.6B · 90%
From the Hugging Face model README
This model is checkpoint 2 of 4 from DPO (Direct Preference Optimization) fine-tuning of Qwen/Qwen3-4B-Base.
Format: Safetensors only (~8 GB) - optimized for vLLM inference.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained(
"Daksh1/qwen3-4b-dpo-ckpt-2",
trust_remote_code=True,
torch_dtype=torch.bfloat16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(
"Daksh1/qwen3-4b-dpo-ckpt-2",
trust_remote_code=True
)
# Generate
messages = [
{"role": "user", "content": "Your question here"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
from vllm import LLM, SamplingParams
# Initialize vLLM
llm = LLM(
model="Daksh1/qwen3-4b-dpo-ckpt-2",
trust_remote_code=True,
dtype="bfloat16",
max_model_len=2048
)
# Create sampling parameters
sampling_params = SamplingParams(
temperature=0.7,
top_p=0.9,
max_tokens=512
)
# Generate
prompts = ["Your question here"]
outputs = llm.generate(prompts, sampling_params)
for output in outputs:
print(output.outputs[0].text)
from vllm import LLM, SamplingParams
# Use local path
llm = LLM(
model="./saved_models/qwen3-4b-dpo-ckpt-2",
trust_remote_code=True,
dtype="bfloat16",
max_model_len=2048
)
Daksh1/qwen3-4b-dpo-ckpt-1Daksh1/qwen3-4b-dpo-ckpt-2Daksh1/qwen3-4b-dpo-ckpt-3Daksh1/qwen3-4b-dpo-ckpt-4