mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-10-23 22:18:06 +08:00
chore(lora): support mixtral in lora example (#343)
This commit is contained in:
@@ -20,7 +20,13 @@ def quantize(weights, config, args):
|
||||
model.load_weights(list(weights.items()))
|
||||
|
||||
# Quantize the model:
|
||||
nn.QuantizedLinear.quantize_module(model, args.q_group_size, args.q_bits)
|
||||
nn.QuantizedLinear.quantize_module(
|
||||
model,
|
||||
args.q_group_size,
|
||||
args.q_bits,
|
||||
linear_class_predicate=lambda m: isinstance(m, nn.Linear)
|
||||
and m.weight.shape[0] != 8,
|
||||
)
|
||||
|
||||
# Update the config:
|
||||
quantized_config["quantization"] = {
|
||||
|
Reference in New Issue
Block a user