]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
gguf-py : fix passing non-native endian tensors (editor-gui and new-metadata) (#17553)
authorAleksei Nikiforov <redacted>
Fri, 28 Nov 2025 19:53:01 +0000 (20:53 +0100)
committerGitHub <redacted>
Fri, 28 Nov 2025 19:53:01 +0000 (20:53 +0100)
commitd82b7a7c1d73c0674698d9601b1bbb0200933f29
tree073c762b79628b830879c53244485acfee344a8c
parent03914c7ef826caf0b6371a6d1de270cda102b542
gguf-py : fix passing non-native endian tensors (editor-gui and new-metadata) (#17553)

gguf_new_metadata.py reads data from reader.
Reader doesn't byteswap tensors to native endianness.
But writer does expect tensors in native endianness to convert them
into requested endianness.

There are two ways to fix this: update reader and do conversion to native endianness and back,
or skip converting endianness in writer in this particular USE-case.

gguf_editor_gui.py doesn't allow editing or viewing tensor data.
Let's go with skipping excessive byteswapping.

If eventually capability to view or edit tensor data is added,
tensor data should be instead byteswapped when reading it.
gguf-py/gguf/gguf_writer.py
gguf-py/gguf/scripts/gguf_editor_gui.py
gguf-py/gguf/scripts/gguf_new_metadata.py