From e814fc12642aa4d6ad3ae5323614c028ad1c2be1 Mon Sep 17 00:00:00 2001 From: blepping Date: Wed, 28 Aug 2024 12:34:08 -0600 Subject: [PATCH] Revert ggml_tensor_name addition --- nodes.py | 3 +-- ops.py | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/nodes.py b/nodes.py index 9df2523..d702e0c 100644 --- a/nodes.py +++ b/nodes.py @@ -77,8 +77,7 @@ def gguf_sd_loader(path, handle_prefix="model.diffusion_model.", require_prefix= sd[sd_key] = GGMLTensor( torch_tensor, tensor_type = tensor.tensor_type, - tensor_shape = shape, - ggml_tensor_name = tensor_name, + tensor_shape = shape ) dt[tensor_type_str] = dt.get(tensor_type_str, 0) + 1 diff --git a/ops.py b/ops.py index 21b4d36..8c12de7 100644 --- a/ops.py +++ b/ops.py @@ -9,14 +9,13 @@ class GGMLTensor(torch.Tensor): """ Main tensor-like class for storing quantized weights """ - def __init__(self, *args, tensor_type, tensor_shape, patches=[], ggml_tensor_name=None, **kwargs): + def __init__(self, *args, tensor_type, tensor_shape, patches=[], **kwargs): super().__init__() self.tensor_type = tensor_type self.tensor_shape = tensor_shape self.patches = patches - self.ggml_tensor_name = ggml_tensor_name - def __new__(cls, *args, tensor_type, tensor_shape, patches=[], ggml_tensor_name=None, **kwargs): + def __new__(cls, *args, tensor_type, tensor_shape, patches=[], **kwargs): return super().__new__(cls, *args, **kwargs) def to(self, *args, **kwargs): @@ -24,7 +23,6 @@ class GGMLTensor(torch.Tensor): new.tensor_type = getattr(self, "tensor_type", None) new.tensor_shape = getattr(self, "tensor_shape", new.data.shape) new.patches = getattr(self, "patches", []).copy() - new.ggml_tensor_name = getattr(self, "ggml_tensor_name", None) return new def clone(self, *args, **kwargs): @@ -46,7 +44,6 @@ class GGMLTensor(torch.Tensor): new.tensor_type = getattr(self, "tensor_type", None) new.tensor_shape = getattr(self, "tensor_shape", new.data.shape) new.patches = getattr(self, "patches", []).copy() - new.ggml_tensor_name = getattr(self, "ggml_tensor_name", None) return new @property