mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Universal ziproot for lazy_loader
This commit is contained in:
@@ -172,14 +172,11 @@ class TorchLazyTensor(LazyTensor):
|
||||
|
||||
CheckpointChunkCache.file_name = filename
|
||||
CheckpointChunkCache.key = self.key
|
||||
try:
|
||||
CheckpointChunkCache.handle = checkpoint.open(
|
||||
f"archive/data/{self.key}", "r"
|
||||
)
|
||||
except KeyError:
|
||||
CheckpointChunkCache.handle = checkpoint.open(
|
||||
f"{filename}/data/{self.key}", "r"
|
||||
)
|
||||
ziproot = checkpoint.namelist()[0].split("/")[0]
|
||||
CheckpointChunkCache.handle = checkpoint.open(f"{ziproot}/data/{self.key}", "r")
|
||||
|
||||
|
||||
|
||||
else:
|
||||
# Cache hit. Hip hip hooray! :^)
|
||||
# print(".", end="", flush=True)
|
||||
@@ -520,8 +517,8 @@ def use_lazy_load(
|
||||
|
||||
torch.load = torch_load
|
||||
|
||||
if HAS_SAFETENSORS:
|
||||
patch_safetensors(callback)
|
||||
#if HAS_SAFETENSORS:
|
||||
#patch_safetensors(callback)
|
||||
|
||||
if dematerialized_modules:
|
||||
# Most devices can just use Accelerate's implementation, but the Transformers on
|
||||
|
Reference in New Issue
Block a user