From 16c6f6bd88fc8a4f994aee4337965f28c5b65663 Mon Sep 17 00:00:00 2001 From: Awni Hannun Date: Mon, 7 Oct 2024 20:05:54 -0700 Subject: [PATCH] fix default model --- llms/mlx_lm/generate.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/llms/mlx_lm/generate.py b/llms/mlx_lm/generate.py index 21d37b62..0bf98ab2 100644 --- a/llms/mlx_lm/generate.py +++ b/llms/mlx_lm/generate.py @@ -11,7 +11,7 @@ from .utils import generate, load DEFAULT_PROMPT = "hello" DEFAULT_MAX_TOKENS = 100 -DEFAULT_TEMP = 0.6 +DEFAULT_TEMP = 0.0 DEFAULT_TOP_P = 1.0 DEFAULT_SEED = 0 DEFAULT_MODEL = "mlx-community/Llama-3.2-3B-Instruct-4bit" @@ -27,8 +27,11 @@ def setup_arg_parser(): parser.add_argument( "--model", type=str, - help="The path to the local model directory or Hugging Face repo.", - default=DEFAULT_MODEL, + help=( + "The path to the local model directory or Hugging Face repo. " + f"If no model is specified, then {DEFAULT_MODEL} is used." + ), + default=None, ) parser.add_argument( "--adapter-path", @@ -169,6 +172,7 @@ def main(): f"used to create the prompt cache ({metadata['model']}) " "is an error." ) + model_path = model_path or DEFAULT_MODEL model, tokenizer = load( model_path,