From 0081085a91b9546bb014cc8d0379bcbe2a8fe850 Mon Sep 17 00:00:00 2001 From: jaycoolslm <86686746+jaycoolslm@users.noreply.github.com> Date: Thu, 1 Jan 2026 04:30:38 +0800 Subject: [PATCH] chore: add model-path param flag for convert API for better clarity (#702) * chore: add model-path param flag for convert API for better clarity Signed-off-by: Jake Hall * chore: refactor argparse for multiple string options Signed-off-by: Jake Hall * Update mlx_lm/convert.py * Update README.md --------- Signed-off-by: Jake Hall Co-authored-by: Awni Hannun --- README.md | 4 ++-- mlx_lm/convert.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9f32fbc..ce71596 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ mlx_lm.generate --help To quantize a model from the command line run: ``` -mlx_lm.convert --hf-path mistralai/Mistral-7B-Instruct-v0.3 -q +mlx_lm.convert --model mistralai/Mistral-7B-Instruct-v0.3 -q ``` For more options run: @@ -185,7 +185,7 @@ You can upload new models to Hugging Face by specifying `--upload-repo` to ``` mlx_lm.convert \ - --hf-path mistralai/Mistral-7B-Instruct-v0.3 \ + --model mistralai/Mistral-7B-Instruct-v0.3 \ -q \ --upload-repo mlx-community/my-4bit-mistral ``` diff --git a/mlx_lm/convert.py b/mlx_lm/convert.py index 6fb2304..3bb6ba1 100644 --- a/mlx_lm/convert.py +++ b/mlx_lm/convert.py @@ -179,7 +179,12 @@ def configure_parser() -> argparse.ArgumentParser: description="Convert Hugging Face model to MLX format" ) - parser.add_argument("--hf-path", type=str, help="Path to the Hugging Face model.") + parser.add_argument( + "--hf-path", + "--model", + type=str, + help="Path to the model. This can be a local path or a Hugging Face Hub model identifier.", + ) parser.add_argument( "--mlx-path", type=str, default="mlx_model", help="Path to save the MLX model." )