diff --git a/src/transformers/quantizers/quantizer_gptq.py b/src/transformers/quantizers/quantizer_gptq.py index 4e7d7272d225..f12ad4ca7e94 100644 --- a/src/transformers/quantizers/quantizer_gptq.py +++ b/src/transformers/quantizers/quantizer_gptq.py @@ -92,7 +92,7 @@ def update_device_map(self, device_map): device_map = {"": torch.device("cpu")} # Only with auto-gptq do not support CPU, we should move the model to cuda if available. if not is_gptqmodel_available() and device_map in ("cpu", {"": torch.device("cpu")}): - device_map == {"": 0} + device_map = {"": 0} return device_map def _process_model_before_weight_loading(self, model: "PreTrainedModel", **kwargs):