# 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-lmfrom mlx_lm import load, generate
model, tokenizer = load("mlx-community/DeepSeek-V4-Pro")
prompt = "Once upon a time in"
text = generate(model, tokenizer, prompt=prompt, verbose=True)
# 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/DeepSeek-V4-Pro") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True)