Downloads · 30 days
0
abhisheksagar/llama-3.2-3b-dpo-LLM-as-Judge-preference
llama-3.2-3b-dpo-LLM-as-Judge-preference is a machine learning model from abhisheksagar. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model is a fine-tuned version of meta-llama/Llama-3.2-3B-instruct using Direct Preference Optimization (DPO) on a preference dataset created by an LLM judge.
Downloads · 30 days
0
Access
Public
Updated Apr 16, 2025
Repo size
115 MB
Likes
0
Public
Click a slice to open those files.
.safetensors97.3 MB · 85%
From the Hugging Face model README
This model is a fine-tuned version of meta-llama/Llama-3.2-3B-instruct using Direct Preference Optimization (DPO) on a preference dataset created by an LLM judge.
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load the model
model_name = "abhisheksagar/llama-3.2-3b-dpo-LLM-as-Judge-preference"
config = PeftConfig.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
config.base_model_name_or_path,
torch_dtype=torch.float16,
device_map="auto"
)
model = PeftModel.from_pretrained(model, model_name)
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
# Generate text
input_text = "What's the most important concept in machine learning?"
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.7,
top_p=0.9
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))