Downloads · 30 days
4
67% of all-time downloads
rishiraj/Phi-3-mini-4k-ORPO
Phi-3-mini-4k-ORPO is a text generation model from rishiraj. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
The Phi-3-Mini-4K-Instruct is a 3.8B parameters, lightweight, state-of-the-art open model trained with the Phi-3 datasets that includes both synthetic data and the filtered publicly available websites data with a focu…
Downloads · 30 days
4
67% of all-time downloads
All-time downloads
6
Public
Repo size
15.4 GB
Likes
1
Public
Click a slice to open those files.
.bin7.6 GB · 100%
From the Hugging Face model README
The Phi-3-Mini-4K-Instruct is a 3.8B parameters, lightweight, state-of-the-art open model trained with the Phi-3 datasets that includes both synthetic data and the filtered publicly available websites data with a focus on high-quality and reasoning dense properties.
Given the nature of the training data, the Phi-3 Mini-4K-Instruct model is best suited for prompts using the chat format as follows.
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
{}
### Input:
{}
### Response:
{}"""
This code snippets show how to get quickly started with running the model on a GPU:
pip install peft transformers bitsandbytes accelerate
from transformers import AutoModelForCausalLM
from transformers import AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"rishiraj/Phi-3-mini-4k-ORPO",
load_in_4bit = True,
)
tokenizer = AutoTokenizer.from_pretrained("rishiraj/Phi-3-mini-4k-ORPO")
# alpaca_prompt = You MUST copy from above!
inputs = tokenizer(
[
alpaca_prompt.format(
"What is a famous tall tower in Paris?", # instruction
"", # input
"", # output - leave this blank for generation!
)
], return_tensors = "pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens = 64, use_cache = True)
tokenizer.batch_decode(outputs)