]> khamidou — GitHub mirrors - safetensors.git/commitdiff
Fix typo (#377)
authorJonathan Chang <31893406+cccntu@users.noreply.github.com>
Fri, 17 Nov 2023 13:45:02 +0000 (21:45 +0800)
committerGitHub <noreply@github.com>
Fri, 17 Nov 2023 13:45:02 +0000 (14:45 +0100)
Signed-off-by: Jonathan Chang <31893406+cccntu@users.noreply.github.com>
bindings/python/py_src/safetensors/numpy.py
bindings/python/py_src/safetensors/tensorflow.py

index 442270a0ce623d9fc1e804fefef25ec2d35c2c07..71814afc16a81ec4bdaac05ab91a38ff9cdf137e 100644 (file)
@@ -70,7 +70,7 @@ def save_file(
     import numpy as np
 
     tensors = {"embedding": np.zeros((512, 1024)), "attention": np.zeros((256, 256))}
-    save(tensors, "model.safetensors")
+    save_file(tensors, "model.safetensors")
     ```
     """
     flattened = {k: {"dtype": v.dtype.name, "shape": v.shape, "data": _tobytes(v)} for k, v in tensor_dict.items()}
index 6b0cbf28b9fd8eb41c298b06fb174318a5fda433..449d5157ed9f5eba47b5a0d82cc8d2c7b97a5efa 100644 (file)
@@ -64,7 +64,7 @@ def save_file(
     import tensorflow as tf
 
     tensors = {"embedding": tf.zeros((512, 1024)), "attention": tf.zeros((256, 256))}
-    save(tensors, "model.safetensors")
+    save_file(tensors, "model.safetensors")
     ```
     """
     np_tensors = _tf2np(tensors)