We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f837c3a commit 1ddb52eCopy full SHA for 1ddb52e
convert-hf-to-gguf.py
@@ -59,7 +59,7 @@ def get_tensors(self) -> Iterator[tuple[str, Tensor]]:
59
from safetensors import safe_open
60
ctx = cast(ContextManager[Any], safe_open(self.dir_model / part_name, framework="pt", device="cpu"))
61
else:
62
- ctx = contextlib.nullcontext(torch.load(self.dir_model / part_name, map_location="cpu"))
+ ctx = contextlib.nullcontext(torch.load(str(self.dir_model / part_name), map_location="cpu", mmap=True, weights_only=True))
63
64
with ctx as model_part:
65
for name in model_part.keys():
0 commit comments