mlx-examples/qwen
2023-12-18 15:30:36 +08:00
..
convert.py Add model and tokenizer options 2023-12-18 15:30:36 +08:00
qwen.py Add model and tokenizer options 2023-12-18 15:30:36 +08:00
README.md Add readme and requirements for qwen example 2023-12-18 15:29:06 +08:00
requirements.txt Add readme and requirements for qwen example 2023-12-18 15:29:06 +08:00

Qwen

Qwen (通义千问) is a language model proposed by Alibaba Cloud1. The architecture of Qwen is similar to Llama except for the bias in the attention layers.

Setup

Download (from huggingface) and conver the model. By default, the model is Qwen/Qwen-1_8B.

python convert.py

This will make the weights.npz file which MLX can read.

Generate

To generate text with the default prompt (default tokenizer is Qwen/Qwen-1_8B):

python qwen.py

To see a list of options, run:

python qwen.py --help

  1. For more details on the model see the official repo of Qwen and the Hugging Face. ↩︎