mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-25 01:41:19 +08:00
chore: fix the load quantization model for deepseek coder (#203)
* chore: fix the load quantization model * change to explicitly check for quantization config
This commit is contained in:
parent
31ddbd7806
commit
1cdbf9e886
@ -244,7 +244,7 @@ def load_model(model_path: str):
|
|||||||
|
|
||||||
model = DeepseekCoder(model_args)
|
model = DeepseekCoder(model_args)
|
||||||
weights = mx.load(str(model_path / "weights.npz"))
|
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)
|
nn.QuantizedLinear.quantize_module(model, **quantization)
|
||||||
model.update(tree_unflatten(list(weights.items())))
|
model.update(tree_unflatten(list(weights.items())))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user