Views
No views yet
mlx-lm.mlx-lm, oMLX, or any MLX app.pip install mlx-lm1from mlx_lm import load, generate
2from mlx_lm.sample_utils import make_sampler
3
4model, tokenizer = load("mlx-community/distilgpt2")
5sampler = make_sampler(temp=0.7)
6print(generate(model, tokenizer, prompt="The history of the Roman Empire began when",
7 max_tokens=80, sampler=sampler))1mlx_lm.generate --model mlx-community/distilgpt2 \
2 --prompt "The history of the Roman Empire began when" --max-tokens 80 --temp 0.7