From 5828703a5a2107cbd87a119b8ad7cd9e196b1849 Mon Sep 17 00:00:00 2001 From: Alex Barron Date: Mon, 2 Dec 2024 11:11:23 -0800 Subject: [PATCH] comment --- llms/mlx_lm/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llms/mlx_lm/utils.py b/llms/mlx_lm/utils.py index cee5676b..6ab3edb7 100644 --- a/llms/mlx_lm/utils.py +++ b/llms/mlx_lm/utils.py @@ -458,13 +458,14 @@ def load_model( weights = model.sanitize(weights) if (quantization := config.get("quantization", None)) is not None: - # Handle legacy models which may not have everything quantized + def class_predicate(p, m): # Handle custom per layer quantizations if p in config["quantization"]: return config["quantization"][p] if not hasattr(m, "to_quantized"): return False + # Handle legacy models which may not have everything quantized return f"{p}.scales" in weights nn.quantize(