Downloads · 30 days
20
6% of all-time downloads
VinitT/Qwen2-0.5B-DPO
Qwen2-0.5B-DPO is a text generation model from VinitT. 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.
- Base Model: Qwen2-0.5B - Fine-tuning Method: Direct Preference Optimization (DPO) - Framework: Unsloth - Quantization: 4-bit QLoRA (during training)
Downloads · 30 days
20
6% of all-time downloads
All-time downloads
327
Public
Parameters
505M
469 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors457 MB · 97%
How the weights are stored.
U8369M · 73%
From the Hugging Face model README
from transformers import AutoTokenizer
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "VinitT/Qwen2-0.5B-DPO",
dtype = None,
load_in_4bit = False,
)
messages = [{"role": "user", "content": "Hello,how can i develop a habit of drawing daily?"}]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_dict=True,
return_tensors="pt"
)
inputs = {k: v.to(model.device) for k, v in inputs.items()}
# Generate
outputs = model.generate(
**inputs,
max_new_tokens=100,
temperature=0.7,
top_p=0.9,
do_sample=True
)
# Decode only the new response (not the prompt)
prompt_len = inputs["input_ids"].shape[-1]
response = tokenizer.decode(outputs[0][prompt_len:], skip_special_tokens=True)
print(response.strip())