Views
No views yet
config_1M.json for hot-swapping to enable YaRN (Yet another RoPE extensioN) for ultra-long context processing up to 1M tokens. For details on using YaRN with this model, see https://huggingface.co/Qwen/Qwen3.6-27B#processing-ultra-long-textstoggle_mtp tool with these instructions so it can dynamically switch between the appropriate weights for maximum performance for both prefill and decode.config_1M.json available for YaRN-enabled 1M context length1# Option 1: pip install
2pip install https://github.com/ml-explore/mlx-lm/archive/refs/pull/990/head.zip
3
4# Option 2: uv run (no virtual env needed)
5uv run --with https://github.com/ml-explore/mlx-lm/archive/refs/pull/990/head.zip python example.py1import mlx_lm
2from mlx_lm.sample_utils import make_sampler
3
4model_path = "petergilani/Qwen3.6-27B-MTP-8bit"
5model, tokenizer = mlx_lm.load(model_path)
6
7sampler = make_sampler(temp=1.0, top_p=0.95, top_k=20)
8
9prompt = "Explain multi-token prediction in language models."
10response = mlx_lm.generate(
11 model,
12 tokenizer,
13 prompt=prompt,
14 sampler=sampler,
15 max_tokens=512,
16 mtp=True # Enable Multi-Token Prediction for faster generation
17)
18print(response)