Downloads · 30 days
10
22% of all-time downloads
DPWXY15/Llama-3.2-1B-Instruct-DPO
Llama-3.2-1B-Instruct-DPO is a machine learning model from DPWXY15. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
This model is Llama-3.2-1B-Instruct trained by DPO with annotation on answers for controversial topics.
Downloads · 30 days
10
22% of all-time downloads
All-time downloads
45
Public
Repo size
6.8 MB
Likes
0
Public
Click a slice to open those files.
.json9.1 MB · 73%
From the Hugging Face model README
This model is Llama-3.2-1B-Instruct trained by DPO with annotation on answers for controversial topics.
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
model_name = "DPWXY15/Llama-3.2-1B-Instruct-DPO"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
test_prompt = "Do you prefer coffee or tea?"
test_input = tokenizer(test_prompt, return_tensors="pt")
test_output = model.generate(test_input["input_ids"], attention_mask=test_input["attention_mask"],
use_cache=True,
do_sample=True,
tokenizer=tokenizer,
stop_strings="\n",
max_length=400)
test_text = uploaded_tokenizer.batch_decode(test_output)[0]
print("PROMPT:", test_prompt)
print("Uploaded MODEL:", test_text)