Instructions to use mlx-community/phi-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/phi-2 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") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use mlx-community/phi-2 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" --prompt "Once upon a time"
- Atomic Chat
Commit History
-
Add base_model metadata (#11)
Verified signature- Add base_model metadata (3cbd33f60134e933c8d567d384722502d89c518f) Co-authored-by: Daniel van Strien <davanstrien@users.noreply.huggingface.co>49116b4
-
Update README.md to download the model at the right location (#8)
- Update README.md to download the model at the right location (7ecf3fc8d2cb2184ee509d3e28c138a7145bbed3) Co-authored-by: Shreyas Karnik <shreyask@users.noreply.huggingface.co>54ceac5
-
fix code snippet (#7)
- fix code snippet (2baaf0257f41112e48bb4dafaa005c4ddc837944) Co-authored-by: Radamés Ajna <radames@users.noreply.huggingface.co>16ae8a3 -
Add config.json (#6)
- Add config.json (29f2dc878cffc18ed465b391b2a6e9ccceac05c1)e92a4c3 -
Update README.md (#5)
- Update README.md (1bc80929dfd489ead079aa6463d736450b2d6aa4)c758099 -
Update README.md (#4)
- Update README.md (d54878380b8dd3ef89d6c42855eb83c483cbbe34)168ad87 -
Remove ln to weights in snippet (#3)
- Remove ln to weights in snippet (2f24bba7ae2c163946e30c8ea25ac64c80034e03)ef43d88 -
MLX code snippet (#2)
- MLX code snippet (79b236497d9c51a5ca880e91819239238225a9fa)674d36e
-
Create README.md (#1)
- Create README.md (2c9c0732798616741762163e5d4d402305cd7e00)bcd77b4 -
Upload weights.npz with huggingface_hub
670af51 -
initial commit
10e2664