mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-30 02:53:41 +08:00
Add readme and requirements for qwen example
This commit is contained in:
parent
ec94fcf430
commit
a8ef549546
29
qwen/README.md
Normal file
29
qwen/README.md
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Qwen
|
||||||
|
|
||||||
|
Qwen (通义千问) is a language model proposed by Alibaba Cloud[^1]. 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`.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
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`):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python qwen.py
|
||||||
|
```
|
||||||
|
|
||||||
|
To see a list of options, run:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python qwen.py --help
|
||||||
|
```
|
||||||
|
|
||||||
|
[^1]: For more details on the model see the official repo of [Qwen](https://github.com/QwenLM/Qwen) and the [Hugging Face](https://huggingface.co/Qwen).
|
4
qwen/requirements.txt
Normal file
4
qwen/requirements.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
mlx
|
||||||
|
numpy
|
||||||
|
transformers>=4.35
|
||||||
|
torch
|
Loading…
Reference in New Issue
Block a user