From a8ef54954678404251fed5ac40d15ce8c4a57226 Mon Sep 17 00:00:00 2001 From: Juni May Date: Mon, 18 Dec 2023 15:29:06 +0800 Subject: [PATCH] Add readme and requirements for qwen example --- qwen/README.md | 29 +++++++++++++++++++++++++++++ qwen/requirements.txt | 4 ++++ 2 files changed, 33 insertions(+) create mode 100644 qwen/README.md create mode 100644 qwen/requirements.txt diff --git a/qwen/README.md b/qwen/README.md new file mode 100644 index 00000000..db1d61e9 --- /dev/null +++ b/qwen/README.md @@ -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). diff --git a/qwen/requirements.txt b/qwen/requirements.txt new file mode 100644 index 00000000..8a318500 --- /dev/null +++ b/qwen/requirements.txt @@ -0,0 +1,4 @@ +mlx +numpy +transformers>=4.35 +torch \ No newline at end of file