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:
blepping
2025-09-09 07:07:45 +02:00
committed by GitHub
parent d247022e3f
commit 6b778afdc9
+1 -1
View File
@@ -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