[package] name = "safetensors" version = "0.5.3" edition = "2021" rust-version = "1.74" homepage = "https://github.com/huggingface/safetensors" repository = "https://github.com/huggingface/safetensors" documentation = "https://docs.rs/safetensors/" license = "Apache-2.0" keywords = ["safetensors", "huggingface", "Tensors", "Pytorch", "Tensorflow"] readme = "./README.md" description = """ Provides functions to read and write safetensors which aim to be safer than their PyTorch counterpart. The format is 8 bytes which is an unsized int, being the size of a JSON header, the JSON header refers the `dtype` the `shape` and `data_offsets` which are the offsets for the values in the rest of the file. """ exclude = [ "rust-toolchain", "target/*", "Cargo.lock"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] hashbrown = { version = "0.15.2", features = ["serde"], optional = true } serde = { version = "1.0.219", default-features = false, features = ["derive"] } serde_json = { version = "1.0.140", default-features = false } # serde = { version = "1.0.219", default-features = false, features = ["std"], optional = true } serde_derive = { version = "1.0.219", default-features = false, optional = true } proc-macro2 = { version = "1.0.95", default-features = false, optional = true } unicode-ident = { version = "1.0.18", default-features = false, optional = true } quote = { version = "1.0.40", default-features = false, optional = true } syn = { version = "2.0.101", default-features = false, optional = true } # serde_json = { version = "1.0.140", default-features = false, features = ["std"], optional = true } itoa = { version = "1.0.15", default-features = false, optional = true } memchr = { version = "2.7.4", default-features = false, features = ["std"], optional = true } ryu = { version = "1.0.20", default-features = false, optional = true } # [dev-dependencies] # criterion = "0.5" # memmap2 = "0.9" # proptest = "1.4" [features] default = ["std"] std = ["serde/default", "serde_json/default"] alloc = ["serde/alloc", "serde_json/alloc", "hashbrown"] [[bench]] name = "benchmark" harness = false