]> khamidou — GitHub mirrors - safetensors.git/commitdiff
Explaining the `__metadata__` in the spec. (#23)
authorNicolas Patry <patry.nicolas@protonmail.com>
Wed, 19 Oct 2022 23:26:56 +0000 (01:26 +0200)
committerGitHub <noreply@github.com>
Wed, 19 Oct 2022 23:26:56 +0000 (01:26 +0200)
README.md
safetensors/README.md
safetensors/src/lib.rs

index 0fd7cbf797a2c639c910a664da8dda4aa686ef81..abbc6837386de30a193c2df78b870c9132204607 100644 (file)
--- a/README.md
+++ b/README.md
@@ -10,6 +10,7 @@ safely (as opposed to pickle) and that is still fast (zero-copy).
 8 bytes: `N`, a u64 int, containing the size of the header
 N bytes: a JSON utf-8 string representing the header.
         The header is a dict like {"TENSOR_NAME": {"dtype": "float16", "shape": [1, 16, 256], "offsets": (X, Y)}}, where X and Y are the offsets in the byte buffer of the tensor data
+        A special key `__metadata__` is allowed to contain free form text map.
 Rest of the file: byte-buffer.
 
 
index 0fd7cbf797a2c639c910a664da8dda4aa686ef81..abbc6837386de30a193c2df78b870c9132204607 100644 (file)
@@ -10,6 +10,7 @@ safely (as opposed to pickle) and that is still fast (zero-copy).
 8 bytes: `N`, a u64 int, containing the size of the header
 N bytes: a JSON utf-8 string representing the header.
         The header is a dict like {"TENSOR_NAME": {"dtype": "float16", "shape": [1, 16, 256], "offsets": (X, Y)}}, where X and Y are the offsets in the byte buffer of the tensor data
+        A special key `__metadata__` is allowed to contain free form text map.
 Rest of the file: byte-buffer.
 
 
index ae08b3ddef5cc673194f89f1aaf21da4b6c0e6e4..74aef0b63f8448c69d5f7d69dfde005364b745f4 100644 (file)
@@ -9,6 +9,7 @@
 //!8 bytes: `N`, a u64 int, containing the size of the header
 //!N bytes: a JSON utf-8 string representing the header.
 //!         The header is a dict like {"TENSOR_NAME": {"dtype": "float16", "shape": [1, 16, 256], "offsets": (X, Y)}}, where X and Y are the offsets in the byte buffer of the tensor data
+//!         A special key `__metadata__` is allowed to contain free form text map.
 //!Rest of the file: byte-buffer.
 //!
 //!