Quanto freeze the model before calibration

This commit is contained in:
Disty0
2024-08-21 19:18:57 +03:00
parent 694d25c161
commit c3ff21c15e
+1 -2
View File
@@ -200,8 +200,7 @@ def optimum_quanto_model(model, op=None, sd_model=None, weights=None, activation
if hasattr(model, "get_input_embeddings"):
backup_embeddings = copy.deepcopy(model.get_input_embeddings())
quanto.quantize(model, weights=weights, activations=activations)
if activations is None:
quanto.freeze(model)
quanto.freeze(model)
if hasattr(model, "set_input_embeddings") and backup_embeddings is not None:
model.set_input_embeddings(backup_embeddings)
if op is not None and shared.opts.quant_shuffle_weights: