Skip to content

Commit

Permalink
Fixing the spec with mention about the buffer which cannot be non-con…
Browse files Browse the repository at this point in the history
…tiguous. (#253)

* Adding specification that the byte buffer needs to be contiguous and
full.

* Fix cargo.lock which messes up benchmarks.
  • Loading branch information
Narsil committed May 22, 2023
1 parent bc06886 commit a7969d4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 356 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
safetensors/target
safetensors/**/Cargo.lock
bindings/python/Cargo.lock
*.bin
*.h5
*.msgpack
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ Notes:
They don't really bring a lot of values but are accepted since they are valid tensors
from traditional tensor libraries perspective (torch, tensorflow, numpy, ..).
- 0-rank Tensors (tensors with shape `[]`) are allowed, they are merely a scalar.
- The byte buffer needs to be entirely indexed, and cannot contain holes. This prevents
the creation of polyglot files.


### Yet another format ?
Expand Down
356 changes: 0 additions & 356 deletions bindings/python/Cargo.lock

This file was deleted.

2 changes: 2 additions & 0 deletions safetensors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ Notes:
They don't really bring a lot of values but are accepted since they are valid tensors
from traditional tensor libraries perspective (torch, tensorflow, numpy, ..).
- 0-rank Tensors (tensors with shape `[]`) are allowed, they are merely a scalar.
- The byte buffer needs to be entirely indexed, and cannot contain holes. This prevents
the creation of polyglot files.


### Yet another format ?
Expand Down
2 changes: 2 additions & 0 deletions safetensors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
//! They don't really bring a lot of values but are accepted since they are valid tensors
//! from traditional tensor libraries perspective (torch, tensorflow, numpy, ..).
//! - 0-rank Tensors (tensors with shape `[]`) are allowed, they are merely a scalar.
//! - The byte buffer needs to be entirely indexed, and cannot contain holes. This prevents
//! the creation of polyglot files.
//!
//!
//!## Yet another format ?
Expand Down

0 comments on commit a7969d4

Please sign in to comment.