]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
ggml: `gguf_init_from_callback` and `gguf_init_from_buffer` (llama/22341)
authorGilad S <redacted>
Mon, 25 May 2026 09:33:29 +0000 (11:33 +0200)
committerGeorgi Gerganov <redacted>
Mon, 25 May 2026 09:44:04 +0000 (12:44 +0300)
commit2979e5f95fa95c4f30fd36eb5e4766448da9da44
tree8889c6d6dc6e2f7210cb9debcd8479edcf409c06
parent44a50ca41a574d596eef4b2d0a4ffcc1575d6000
ggml: `gguf_init_from_callback` and `gguf_init_from_buffer` (llama/22341)

* ggml: implement `gguf_init_from_buffer`

* test: `gguf_init_from_buffer`

* fix: memory breakdown for a model loaded with `no_alloc` from a file is consistent with being loaded from a buffer

* fix: use `GGML_UNUSED`

Co-authored-by: Copilot <redacted>
* fix: remove `total_size` from `gguf_reader`

* fix: file offset calculation, rename `offset` to `data_offset`

Co-authored-by: Copilot <redacted>
* refactor: extract model loader bug fixes to another PR

* feat: add `gguf_init_from_callback`

* fix: always require a max expected size

* fix: change `gguf_reader_callback_t`'s `output` type to `void *`, change `max_expected_size` and offsets to `uint64_t`

* fix: harden against offset overflow in buffer read

* fix: remove seek behavior from the callback

* feat: `max_chunk_read == 0` means `SIZE_MAX`

* fix: seeking in a gguf file with no tensors

---------

Co-authored-by: Copilot <redacted>
ggml/include/gguf.h
ggml/src/gguf.cpp