safetensors 0.4.5

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.
Documentation
Build #1348996 2024-09-05T13:42:47.149407+00:00
# rustc version
rustc 1.83.0-nightly (4ac7bcbaa 2024-09-04)# docs.rs version
docsrs 0.6.0 (a6155e2c 2024-08-13)# build log
[INFO] running `Command { std: "docker" "create" "-v" "/home/cratesfyi/workspace-builder/builds/safetensors-0.4.5/target:/opt/rustwide/target:rw,Z" "-v" "/home/cratesfyi/workspace-builder/builds/safetensors-0.4.5/source:/opt/rustwide/workdir:ro,Z" "-v" "/home/cratesfyi/workspace-builder/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/home/cratesfyi/workspace-builder/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "DOCS_RS=1" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "6442450944" "--cpus" "6" "--user" "1001:1001" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:96c0aa5895ecf336b730ef27bcdde6e21027415df19888aad3cf1448e5d65d90" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "rustdoc" "--lib" "-Zrustdoc-map" "--config" "build.rustdocflags=[\"--cfg\", \"docsrs\", \"-Z\", \"unstable-options\", \"--emit=invocation-specific\", \"--resource-suffix\", \"-20240904-1.83.0-nightly-4ac7bcbaa\", \"--static-root-path\", \"/-/rustdoc.static/\", \"--cap-lints\", \"warn\", \"--extern-html-root-takes-precedence\"]" "--offline" "-Zunstable-options" "--config=doc.extern-map.registries.crates-io=\"https://docs.rs/{pkg_name}/{version}/x86_64-unknown-linux-gnu\"" "-Zrustdoc-scrape-examples" "-j6" "--target" "x86_64-unknown-linux-gnu", kill_on_drop: false }`
[INFO] [stderr] WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
[INFO] [stdout] ba00395ebaf37915e1fa45603c675e2c6a69b801ef11e28dd9a6fa00e940d6ec
[INFO] running `Command { std: "docker" "start" "-a" "ba00395ebaf37915e1fa45603c675e2c6a69b801ef11e28dd9a6fa00e940d6ec", kill_on_drop: false }`
[INFO] [stderr] warning: target filter specified, but no targets matched; this is a no-op
[INFO] [stderr]  Documenting safetensors v0.4.5 (/opt/rustwide/workdir)
[INFO] [stderr]     Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.39s
[INFO] [stderr]    Generated /opt/rustwide/target/x86_64-unknown-linux-gnu/doc/safetensors/index.html
[INFO] running `Command { std: "docker" "inspect" "ba00395ebaf37915e1fa45603c675e2c6a69b801ef11e28dd9a6fa00e940d6ec", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "rm" "-f" "ba00395ebaf37915e1fa45603c675e2c6a69b801ef11e28dd9a6fa00e940d6ec", kill_on_drop: false }`
[INFO] [stdout] ba00395ebaf37915e1fa45603c675e2c6a69b801ef11e28dd9a6fa00e940d6ec