From bcb033f2e0c18c2737b7832140ccebfe5958d0a1 Mon Sep 17 00:00:00 2001 From: John B Nelson Date: Fri, 20 Jan 2023 02:07:11 -0800 Subject: [PATCH] Minor pydoc fixes for torch bindings (#167) --- bindings/python/py_src/safetensors/torch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/python/py_src/safetensors/torch.py b/bindings/python/py_src/safetensors/torch.py index 1df67f3..32964c8 100644 --- a/bindings/python/py_src/safetensors/torch.py +++ b/bindings/python/py_src/safetensors/torch.py @@ -10,7 +10,7 @@ from safetensors import deserialize, safe_open, serialize, serialize_file def save(tensors: Dict[str, torch.Tensor], metadata: Optional[Dict[str, str]] = None) -> bytes: """ - Saves a dictionnary of tensors into raw bytes in safetensors format. + Saves a dictionary of tensors into raw bytes in safetensors format. Args: tensors (`Dict[str, torch.Tensor]`): @@ -44,7 +44,7 @@ def save_file( metadata: Optional[Dict[str, str]] = None, ): """ - Saves a dictionnary of tensors into raw bytes in safetensors format. + Saves a dictionary of tensors into raw bytes in safetensors format. Args: tensors (`Dict[str, torch.Tensor]`): @@ -66,7 +66,7 @@ def save_file( import torch tensors = {"embedding": torch.zeros((512, 1024)), "attention": torch.zeros((256, 256))} - save(tensors, "model.safetensors") + save_file(tensors, "model.safetensors") ``` """ serialize_file(_flatten(tensors), filename, metadata=metadata) -- 2.43.0