From cfe1f5b514f267aad080afe5630bd6e13f43a6e1 Mon Sep 17 00:00:00 2001 From: somebody Date: Fri, 7 Jul 2023 14:49:46 -0500 Subject: [PATCH] Stub seek_offset for cache sorting in load loop The way Safetensors individual weight loading is implemented doesn't take full advantage of the cache ordering system thing, so this can just be left at zero for now. --- modeling/lazy_loader.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modeling/lazy_loader.py b/modeling/lazy_loader.py index 4dcbe392..cc1cb745 100644 --- a/modeling/lazy_loader.py +++ b/modeling/lazy_loader.py @@ -222,6 +222,9 @@ class SafetensorsLazyTensor(LazyTensor): self.key = key self.location = location + # Stub for cache sorting + self.seek_offset = 0 + def __view(self, f: Callable): return f"{type(self).__name__}(checkpoint_file={f(self.checkpoint_file)}, key={f(self.key)}, location={f(self.location)})"