From 6b778afdc938427116cb72e683d28e42baf67082 Mon Sep 17 00:00:00 2001 From: blepping <157360029+blepping@users.noreply.github.com> Date: Mon, 8 Sep 2025 23:07:45 -0600 Subject: [PATCH] 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 --- ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ops.py b/ops.py index 41d42f5..ff9b960 100644 --- a/ops.py +++ b/ops.py @@ -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