MLX How to use mlx-community/CodeLlama-7b-Python-mlx 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/CodeLlama-7b-Python-mlx")
prompt = "Once upon a time in"
text = generate(model, tokenizer, prompt=prompt, verbose=True)