Downloads · 30 days
15
5% of all-time downloads
Syed-Hasan-8503/phi-2-ORPO
phi-2-ORPO is a text generation model from Syed-Hasan-8503. 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.
Phi-2-ORPO is a fine-tuned version of microsoft/phi-2 on argilla/dpo-mix-7k preference dataset using Odds Ratio Preference Optimization (ORPO). The model has been trained for 1 epoch.
Downloads · 30 days
15
5% of all-time downloads
All-time downloads
327
Public
Parameters
2.8B
33.4 GB on disk
Likes
6
Public
Click a slice to open those files.
.distcp27.8 GB · 83%
From the Hugging Face model README
Phi-2-ORPO is a fine-tuned version of microsoft/phi-2 on argilla/dpo-mix-7k preference dataset using Odds Ratio Preference Optimization (ORPO). The model has been trained for 1 epoch.
This model has been trained using LazyORPO. A colab notebook that makes the training process much easier. Based on ORPO paper. This notebook has been created by Zain Ul Abideen
Odds Ratio Preference Optimization (ORPO) proposes a new method to train LLMs by combining SFT and Alignment into a new objective (loss function), achieving state of the art results. Some highlights of this techniques are:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
torch.set_default_device("cuda")
model = AutoModelForCausalLM.from_pretrained("abideen/phi2-pro", torch_dtype="auto", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("abideen/phi2-pro", trust_remote_code=True)
inputs = tokenizer('''
"""
Write a detailed analogy between mathematics and a lighthouse.
"""''', return_tensors="pt", return_attention_mask=False)
outputs = model.generate(**inputs, max_length=200)
text = tokenizer.batch_decode(outputs)[0]
print(text)