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
- 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"
No such file or directory phi2.py
#10
by lucifer89 - opened
There's no phi2.py file in the files and versions
yeah, the phi2.py file is missing.
Did everybody got it working somehow? and if yes where did you find the thing? or what did we wrong?
Hey, I initialized a phi2 and a phixtral model several weeks ago to test it. I had to make some changes in certain files. Could you post the error msg? I might be able to help out.
hi @BenBenser , when try to run the model, it does not contains the phi.py python script:
huggingface-cli download --local-dir-use-symlinks False --local-dir llms/phi2 mlx-community/phi-2
β llms git:(main) β tree .
.
βββ phi2
βββ README.md
βββ config.json
βββ weights.npz
2 directories, 3 files