Fix attempt to create a tensor with dtype "target" (#330)
* Fix attempt to create a tensor with dtype "target" * Check if dequant_dtype is None before string comparison with target
This commit is contained in:
@@ -153,7 +153,7 @@ class GGMLLayer(torch.nn.Module):
|
||||
# Take into account space required for dequantizing the largest tensor
|
||||
if self.largest_layer:
|
||||
shape = getattr(self.weight, "tensor_shape", self.weight.shape)
|
||||
dtype = self.dequant_dtype or torch.float16
|
||||
dtype = (self.dequant_dtype and self.dequant_dtype != "target") or torch.float16
|
||||
temp = torch.empty(*shape, device=torch.device("meta"), dtype=dtype)
|
||||
destination[prefix + "temp.weight"] = temp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user