Skip to content

Commit bcb033f

Browse files
authored
Minor pydoc fixes for torch bindings (#167)
1 parent a404265 commit bcb033f

File tree

1 file changed

+3
-3
lines changed
  • bindings/python/py_src/safetensors

1 file changed

+3
-3
lines changed

bindings/python/py_src/safetensors/torch.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def save(tensors: Dict[str, torch.Tensor], metadata: Optional[Dict[str, str]] = None) -> bytes:
1212
"""
13-
Saves a dictionnary of tensors into raw bytes in safetensors format.
13+
Saves a dictionary of tensors into raw bytes in safetensors format.
1414
1515
Args:
1616
tensors (`Dict[str, torch.Tensor]`):
@@ -44,7 +44,7 @@ def save_file(
4444
metadata: Optional[Dict[str, str]] = None,
4545
):
4646
"""
47-
Saves a dictionnary of tensors into raw bytes in safetensors format.
47+
Saves a dictionary of tensors into raw bytes in safetensors format.
4848
4949
Args:
5050
tensors (`Dict[str, torch.Tensor]`):
@@ -66,7 +66,7 @@ def save_file(
6666
import torch
6767
6868
tensors = {"embedding": torch.zeros((512, 1024)), "attention": torch.zeros((256, 256))}
69-
save(tensors, "model.safetensors")
69+
save_file(tensors, "model.safetensors")
7070
```
7171
"""
7272
serialize_file(_flatten(tensors), filename, metadata=metadata)

0 commit comments

Comments
 (0)