[Bugfix] Fix lora loading for Compressed Tensors in #9120 (#9179)

This commit is contained in:
Ahmad Fahadh Ilyas
2024-10-09 05:10:44 -07:00
committed by GitHub
parent dc4aea677a
commit 21906a6f50

View File

@ -39,6 +39,9 @@ def _get_lora_device(base_layer: nn.Module) -> torch.device:
# unquantizedLinear
if hasattr(base_layer, "weight"):
return base_layer.weight.device
# Compressed Tensor
elif hasattr(base_layer, "weight_packed"):
return base_layer.weight_packed.device
# GPTQ/AWQ
elif hasattr(base_layer, "qweight"):
return base_layer.qweight.device