The model.safetensors file currently published at
huggingface.co/ruvnet/wifi-densepose-pretrained has a malformed header:
the 8-byte u64 declares 1464 header bytes, the JSON document ends at
byte 1461, and the last 3 bytes of the header zone are literal 0x00
padding instead of the spec-required 0x20 spaces. Strict safetensors
readers — Rust safetensors crate, Candle, safetensors.torch.load_file —
reject with 'SafetensorError: trailing characters at line 1 column 1462'.
This commit:
- adds docs/huggingface/SAFETENSORS-HEADER-BUG.md with byte-level
evidence, spec citation, source-of-bug location (the SafeTensorsWriter
in vendor/ruvector/.../export.js — separate repo at ruvnet/ruvector),
list of three trainer scripts that go through this path
(train-wiflow.js, train-ruvllm.js, train-camera-free.js), table of
affected vs lenient consumers, 10-line strict-reader repro that
reproduces the exact error class against a synthetic file, proposed
upstream fix (0x20 padding or no padding), and a follow-ups checklist
including the need to re-train/re-export and re-upload the HF artifact
- flags the bundle as needing republish under [Unreleased] in CHANGELOG.md
- updates the HF model section of docs/user-guide.md so the load example
now patches the header with scripts/fix-safetensors-header.py before
calling safetensors.torch.load_file (which would otherwise crash on
the current bundle), and flips the Python/PyTorch row of the
consumer-status table from 'Works' to 'Broken header — strict readers
reject; patch with scripts/fix-safetensors-header.py'