Download include/ling3/decoder_state.h from Sariel00/Ling-3.0-tiny-RKNN: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/Sariel00/Ling-3.0-tiny-RKNN/resolve/main/include/ling3/decoder_state.h
- Command line
-
hf download hf://Sariel00/Ling-3.0-tiny-RKNN/include/ling3/decoder_state.h
-
curl -L -o decoder_state.h https://huggingface.co/Sariel00/Ling-3.0-tiny-RKNN/resolve/main/include/ling3/decoder_state.h
1.19 kB
| namespace ling3 { | |
| // Complete, portable numerical state, independent of a decoder's live buffers. | |
| // Not a chat history or a suspended sampler. Treat published states as immutable. | |
| struct AttentionState { | |
| GdnState gdn; | |
| std::array<std::vector<float>, 3> conv; | |
| std::vector<std::uint16_t> keys, values; | |
| std::size_t bytes() const; | |
| }; | |
| struct DecoderState { | |
| std::string signature; | |
| std::size_t position = 0; | |
| std::vector<AttentionState> layers; | |
| std::size_t bytes() const; | |
| }; | |
| // Versioned little-endian format, per-buffer CRC, bounded allocations. Loading | |
| // validates every layer before the engine can mutate any live numerical state. | |
| void ValidateDecoderState(const DecoderState & state, std::string_view signature, | |
| std::size_t capacity); | |
| void WriteDecoderState(const DecoderState & state, const std::filesystem::path & path); | |
| DecoderState ReadDecoderState(const std::filesystem::path & path, | |
| std::string_view signature, std::size_t capacity); | |
| } // namespace ling3 | |