Create executables for generate, lora, server, merge, convert (#682)

* feat: create executables mlx_lm.<cmd>

* nits in docs

---------

Co-authored-by: Awni Hannun <awni@apple.com>
This commit is contained in:
Phúc H. Lê Khắc
2024-04-17 00:08:49 +01:00
committed by GitHub
parent 7d7e236061
commit 35206806ac
10 changed files with 54 additions and 27 deletions

View File

@@ -66,7 +66,7 @@ To see a description of all the arguments you can do:
You can also use `mlx-lm` from the command line with:
```
python -m mlx_lm.generate --model mistralai/Mistral-7B-Instruct-v0.1 --prompt "hello"
mlx_lm.generate --model mistralai/Mistral-7B-Instruct-v0.1 --prompt "hello"
```
This will download a Mistral 7B model from the Hugging Face Hub and generate
@@ -75,19 +75,19 @@ text using the given prompt.
For a full list of options run:
```
python -m mlx_lm.generate --help
mlx_lm.generate --help
```
To quantize a model from the command line run:
```
python -m mlx_lm.convert --hf-path mistralai/Mistral-7B-Instruct-v0.1 -q
mlx_lm.convert --hf-path mistralai/Mistral-7B-Instruct-v0.1 -q
```
For more options run:
```
python -m mlx_lm.convert --help
mlx_lm.convert --help
```
You can upload new models to Hugging Face by specifying `--upload-repo` to
@@ -95,7 +95,7 @@ You can upload new models to Hugging Face by specifying `--upload-repo` to
[MLX Hugging Face community](https://huggingface.co/mlx-community) you can do:
```
python -m mlx_lm.convert \
mlx_lm.convert \
--hf-path mistralai/Mistral-7B-v0.1 \
-q \
--upload-repo mlx-community/my-4bit-mistral