Instructions to use mlx-community/phi-2-dpo-7k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/phi-2-dpo-7k with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/phi-2-dpo-7k") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- MLX LM
How to use mlx-community/phi-2-dpo-7k with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "mlx-community/phi-2-dpo-7k" --prompt "Once upon a time"
phi-2-dpo-7k
This is a finetuned version of microsoft/phi-2. Finetuned on a cocktail of 7k chat interaction from argilla latest DPO datase: orca pairs, ultrafeedback ratings, and capybara-dpo.
Refer to the original model card for more details on the model.
Use with mlx
pip install mlx
from mlx_lm import load, generate
model, tokenizer = load("mlx-community/phi-2-dpo-7k")
response = generate(model, tokenizer, prompt="Similarity between pizza and quantum mechanics, in few words, use rhymes\nOutput: ", max_tokens=100, verbose=True)
- Downloads last month
- 42
Hardware compatibility
Log In to add your hardware
Quantized
