Instructions to use mlx-community/zephyr-7b-beta with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/zephyr-7b-beta 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/zephyr-7b-beta") 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/zephyr-7b-beta 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/zephyr-7b-beta" --prompt "Once upon a time"
- Atomic Chat
Mistral test.py fails
Hi all,
Love the MLX work and have been getting it running on my M3 Max. I'm getting some strange results though. Here's the test.py run:
FAIL: test_generate (main.TestMistral)
Traceback (most recent call last):
File "/Users/egs/repos/mlx-examples/llms/mistral/test.py", line 75, in test_generate
self.assertEqual(tokens, expected)
AssertionError: Lists differ: [302, 272, 16762, 9588, 12807, 2867, 2135, 28723, 851[116 chars] 297] != [302, 272, 11843, 11837, 1587, 28723, 851, 349, 865, [108 chars], 13]
First differing element 2:
16762
11843
[302,
272,
- 16762,
- 9588,
- 11843,
- 11837,
- 12807,
? ^ -
- 1587,
? ^
- 2867,
- 2135,
28723,
851,
349,
865,
264,
1369,
28723,
13,
13,
- 3381,
- 456,
- 654,
- 1014,
- 16762,
- 9588,
- 12807,
- 2867,
- 2135,
- 325,
- 28749,
- 8340,
- 28731,
- 403,
264, - 1587,
- 297]
- 1353,
- 11843,
- 28725,
- 368,
- 682,
- 347,
- 2240,
- 767,
- 298,
- 511,
- 28723,
- 13]
Ran 2 tests in 7.400s
FAILED (failures=1)
Any thoughts?
Hi @Klaatu I'm afraid this may have to do with the M3 chip itself as pointed out by @awni at https://github.com/ml-explore/mlx-examples/issues/58
Does it just fail when using Mistral-based models or with the rest of the examples too?