You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support the following syntax for obtaining an object containing the tensor shapes and other metadata without loading the actual tensors:
model = safetensors.torch.load_file(path, device="meta")
Motivation
This would be analogous to torch.load(path, map_location="meta") and allows the metadata to be interrogated without having to load the whole safetensors into memory.
Your contribution
Happy to test the implementation.
The text was updated successfully, but these errors were encountered:
Feature request
Support the following syntax for obtaining an object containing the tensor shapes and other metadata without loading the actual tensors:
Motivation
This would be analogous to
torch.load(path, map_location="meta")
and allows the metadata to be interrogated without having to load the whole safetensors into memory.Your contribution
Happy to test the implementation.
The text was updated successfully, but these errors were encountered: