Downloads · 30 days
9
3% of all-time downloads
QueryloopAI/Phi-3-mini-128K-instruct-cpo-simpo
Phi-3-mini-128K-instruct-cpo-simpo is a feature extraction model from QueryloopAI. Use it when you need embeddings to search or compare text. It is set up for transformers. The card lists the license as apache-2.0.
This repository contains the Phi-3-mini-128K-instruct model enhanced with the CPO-SimPO technique. CPO-SimPO combines Contrastive Preference Optimization (CPO) and Simple Preference Optimization (SimPO).
Downloads · 30 days
9
3% of all-time downloads
All-time downloads
279
Public
Parameters
3.7B
7.4 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors7.4 GB · 100%
From the Hugging Face model README
This repository contains the Phi-3-mini-128K-instruct model enhanced with the CPO-SimPO technique. CPO-SimPO combines Contrastive Preference Optimization (CPO) and Simple Preference Optimization (SimPO).
Phi-3-mini-128K-instruct is a model optimized for instruction-based tasks. This approach has demonstrated notable improvements in key benchmarks, pushing the boundaries of AI preference learning.
CPO-SimPO is a novel technique, which combines elements from CPO and SimPO:
To use this model, you need to install the transformers library from Hugging Face.
pip install transformers
Here's an example of how to perform inference with the model:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
torch.random.manual_seed(0)
model = AutoModelForCausalLM.from_pretrained(
"QueryloopAI/Phi-3-mini-128K-instruct-cpo-simpo",
device_map="cuda",
torch_dtype="auto",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained("Syed-Hasan-8503/Phi-3-mini-128K-instruct-cpo-simpo")
messages = [
{"role": "user", "content": "Can you provide ways to eat combinations of bananas and dragonfruits?"},
{"role": "assistant", "content": "Sure! Here are some ways to eat bananas and dragonfruits together: 1. Banana and dragonfruit smoothie: Blend bananas and dragonfruits together with some milk and honey. 2. Banana and dragonfruit salad: Mix sliced bananas and dragonfruits together with some lemon juice and honey."},
{"role": "user", "content": "What about solving an 2x + 3 = 7 equation?"},
]
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
)
generation_args = {
"max_new_tokens": 500,
"return_full_text": False,
"temperature": 0.0,
"do_sample": False,
}
output = pipe(messages, **generation_args)
print(output[0]['generated_text'])