mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-30 10:56:38 +08:00
12 lines
246 B
Python
12 lines
246 B
Python
![]() |
import mlx_lm
|
||
|
|
||
|
model, tokenizer = mlx_lm.load("/Users/llwu/models/mlx/Meta-Llama-3.1-8B-4bit")
|
||
|
|
||
|
for s in mlx_lm.stream_generate(
|
||
|
model,
|
||
|
tokenizer,
|
||
|
prompt="Meta Llama 3.1 is a ",
|
||
|
max_tokens=100,
|
||
|
):
|
||
|
print(s, end="", flush=True)
|