Downloads · 30 days
0
ShAIkespear/Phi-2_DPO_M2
Phi-2_DPO_M2 is a machine learning model from ShAIkespear. 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 transformers. The card lists the license as mit.
A LoRA-finetuned version of microsoft/phi-2 specialized for multiple-choice question answering (MCQA), particularly in STEM domains. This model represents the Direct Preference Optimization (DPO) phase of the ShAIkesp…
Downloads · 30 days
0
Access
Public
Updated Nov 1, 2025
Repo size
26.2 MB
Likes
0
Public
Click a slice to open those files.
.safetensors26.2 MB · 89%
From the Hugging Face model README
A LoRA-finetuned version of microsoft/phi-2 specialized for multiple-choice question answering (MCQA), particularly in STEM domains.
This model represents the Direct Preference Optimization (DPO) phase of the ShAIkespear project. It provides strong baseline reasoning and structured answer generation in the format ### Question → ### Explanation → ### Answer.
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("ShAIkespear/Phi-2_DPO_M2")
model = AutoModelForCausalLM.from_pretrained("ShAIkespear/Phi-2_DPO_M2", device_map="auto")
prompt = "### Question: What is the chemical symbol for water?\n### Explanation: Water is composed of hydrogen and oxygen.\n### Answer:"
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=10)
print(tok.decode(out[0], skip_special_tokens=True))