From 9aeadd40dc349ae3834cb4da4fc41713b5335462 Mon Sep 17 00:00:00 2001
From: Anchen
Date: Sat, 30 Dec 2023 00:25:38 +1100
Subject: [PATCH] chore: fix the load quantization model for deepseek coder
(#203)
* chore: fix the load quantization model
* change to explicitly check for quantization config
---
llms/deepseek-coder/deepseek_coder.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llms/deepseek-coder/deepseek_coder.py b/llms/deepseek-coder/deepseek_coder.py
index 3f3928e7..9b8a8a3e 100644
--- a/llms/deepseek-coder/deepseek_coder.py
+++ b/llms/deepseek-coder/deepseek_coder.py
@@ -244,7 +244,7 @@ def load_model(model_path: str):
model = DeepseekCoder(model_args)
weights = mx.load(str(model_path / "weights.npz"))
- if quantization := config.get("quantization", False):
+ if quantization is not None:
nn.QuantizedLinear.quantize_module(model, **quantization)
model.update(tree_unflatten(list(weights.items())))