]> khamidou — GitHub mirrors - safetensors.git/commitdiff
Missing files. (#282)
authorNicolas Patry <patry.nicolas@protonmail.com>
Tue, 27 Jun 2023 09:39:55 +0000 (11:39 +0200)
committerGitHub <noreply@github.com>
Tue, 27 Jun 2023 09:39:55 +0000 (11:39 +0200)
* Update README.md

* Missing files.

---------

Co-authored-by: iacore <74560659+iacore@users.noreply.github.com>
README.md
safetensors/README.md
safetensors/src/lib.rs

index 45b2dca90e60c5375eababbf0408e3c7a7a4987d..169c7ace69c9061e0b99400d0e9f60e3a290c3aa 100644 (file)
--- a/README.md
+++ b/README.md
@@ -77,7 +77,7 @@ with safe_open("model.safetensors", framework="pt", device="cpu") as f:
 
 - 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": "F16", "shape": [1, 16, 256], "offsets": [BEGIN, END]}, "NEXT_TENSOR_NAME": {...}, ...}`, where offsets point to the tensor data relative to the beginning of the byte buffer, with `BEGIN` as the starting offset and `END` as the one-past offset (so total tensor byte size = `END - BEGIN`).
+  - The header is a dict like `{"TENSOR_NAME": {"dtype": "F16", "shape": [1, 16, 256], "data_offsets": [BEGIN, END]}, "NEXT_TENSOR_NAME": {...}, ...}`, where offsets point to the tensor data relative to the beginning of the byte buffer, with `BEGIN` as the starting offset and `END` as the one-past offset (so total tensor byte size = `END - BEGIN`).
   - A special key `__metadata__` is allowed to contain free form text-to-text map.
 - Rest of the file: byte-buffer.
 
index 45b2dca90e60c5375eababbf0408e3c7a7a4987d..169c7ace69c9061e0b99400d0e9f60e3a290c3aa 100644 (file)
@@ -77,7 +77,7 @@ with safe_open("model.safetensors", framework="pt", device="cpu") as f:
 
 - 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": "F16", "shape": [1, 16, 256], "offsets": [BEGIN, END]}, "NEXT_TENSOR_NAME": {...}, ...}`, where offsets point to the tensor data relative to the beginning of the byte buffer, with `BEGIN` as the starting offset and `END` as the one-past offset (so total tensor byte size = `END - BEGIN`).
+  - The header is a dict like `{"TENSOR_NAME": {"dtype": "F16", "shape": [1, 16, 256], "data_offsets": [BEGIN, END]}, "NEXT_TENSOR_NAME": {...}, ...}`, where offsets point to the tensor data relative to the beginning of the byte buffer, with `BEGIN` as the starting offset and `END` as the one-past offset (so total tensor byte size = `END - BEGIN`).
   - A special key `__metadata__` is allowed to contain free form text-to-text map.
 - Rest of the file: byte-buffer.
 
index 8e201af15f1efb9aafe6d576f30c90c52b7284a8..f3dcf867474adb178a1b795b47bf772f81832fc3 100644 (file)
@@ -54,7 +54,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": "F16", "shape": [1, 16, 256], "offsets": [BEGIN, END]}, "NEXT_TENSOR_NAME": {...}, ...}`, where offsets point to the tensor data relative to the beginning of the byte buffer, with `BEGIN` as the starting offset and `END` as the one-past offset (so total tensor byte size = `END - BEGIN`).
+//!   - The header is a dict like `{"TENSOR_NAME": {"dtype": "F16", "shape": [1, 16, 256], "data_offsets": [BEGIN, END]}, "NEXT_TENSOR_NAME": {...}, ...}`, where offsets point to the tensor data relative to the beginning of the byte buffer, with `BEGIN` as the starting offset and `END` as the one-past offset (so total tensor byte size = `END - BEGIN`).
 //!   - A special key `__metadata__` is allowed to contain free form text-to-text map.
 //! - Rest of the file: byte-buffer.
 //!