From ef32379bc6fe5f20198f9823d0bbc95843429512 Mon Sep 17 00:00:00 2001 From: amcox886 <155285242+amcox886@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:23:43 +0000 Subject: [PATCH] Update README.md (#530) * Update README.md The default behaviour of where the convert.py saved files was wrong. It also was inconsistent with how the later script test.py is trying to use them (and assuming naming convention). I don't actually see a quick way to automate this since--as written--the target directory is set directly by an argument. It would probably be best to rewrite it so that the argument is used as an override variable, but the default behaviour is to construct a file path based on set and unset arugments. This also is complex because "defaults" are assumed in the naming convention as well. * Update README.md Created an actual script that'll run and do this correctly. * Update README.md Typo fix: mlx-models should have been mlx_models. This conforms with standard later in the mlx-examples/whisper code. * Update README.md Removed the larger script and changed it back to the simpler script as before. * nits in readme --------- Co-authored-by: Awni Hannun --- whisper/README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/whisper/README.md b/whisper/README.md index 847d5b8b..4d41a69f 100644 --- a/whisper/README.md +++ b/whisper/README.md @@ -39,8 +39,19 @@ To generate a 4-bit quantized model, use `-q`. For a full list of options: python convert.py --help ``` -By default, the conversion script will make the directory `mlx_models/tiny` -and save the converted `weights.npz` and `config.json` there. +By default, the conversion script will make the directory `mlx_models` +and save the converted `weights.npz` and `config.json` there. + +Each time it is run, `convert.py` will overwrite any model in the provided +path. To save different models, make sure to set `--mlx-path` to a unique +directory for each converted model. For example: + +```bash +model="tiny" +python convert.py --torch-name-or-path ${model} --mlx-path mlx_models/${model}_fp16 +python convert.py --torch-name-or-path ${model} --dtype float32 --mlx-path mlx_models/${model}_fp32 +python convert.py --torch-name-or-path ${model} -q --q_bits 4 --mlx-path mlx_models/${model}_quantized_4bits +``` ### Run