TinyDecide / esp32 /tinydecide /src /model_data.S
TheREZOR's picture
Python, Rust and ESP32 engines, shared conformance set, promo video
f2878d0 verified
Raw History Blame Contribute Delete
684 Bytes
// Embeds model.bin and vocab.bin in flash (.rodata, MMU-mapped) when the ESP-IDF component is built
// with CONFIG_TINYDECIDE_EMBED_MODEL (CMakeLists.txt defines TINYDECIDE_EMBED and the include path).
// The PIE kernel loads 128-bit words, so the model starts on a 16-byte boundary; all Q4 offsets
// inside it are multiples of 16 (checked by tools/pack.mjs).
#if defined(TINYDECIDE_EMBED)
.section .rodata.td_model, "a"
.balign 16
.global td_model_bin
td_model_bin:
.incbin "model.bin"
.global td_model_bin_end
td_model_bin_end:
.balign 16
.global td_vocab_bin
td_vocab_bin:
.incbin "vocab.bin"
.global td_vocab_bin_end
td_vocab_bin_end:
#endif