fix: EETQLinear with bias in layers.py

This commit is contained in:
zhaosida 2023-10-19 11:20:11 +08:00
parent 3af1a11401
commit 4d0f5c5de6

View File

@ -155,10 +155,7 @@ class EETQLinear(nn.Module):
device = weight.device
weight = torch.t(weight).contiguous().cpu()
weight, scale = quant_weights(weight, torch.int8, False)
if bias:
bias = weights.get_tensor(f"{prefix}.bias")
else:
bias = None
self.weight = weight.cuda(device)
self.scale = scale.cuda(device)
self.bias = bias.cuda(device) if bias is not None else None