]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
convert.py: Fix loading safetensors and ggml format on Windows (#991)
authorcomex <redacted>
Sat, 15 Apr 2023 21:53:21 +0000 (14:53 -0700)
committerGitHub <redacted>
Sat, 15 Apr 2023 21:53:21 +0000 (23:53 +0200)
commit74f5899df4a6083fc467b620baa1cf821e37799d
tree8abf4798edc99e17e87f36d7781b60a1ba2c7b8b
parent2f7c8e014e3c0ceaf39688845c2ff6f919fb03b7
convert.py: Fix loading safetensors and ggml format on Windows (#991)

Calling `mmap.mmap` on Windows apparently resets the file offset of the
raw file object (and makes the BufferedReader return a *negative* file
offset).  For safetensors, avoid using the file offset after calling
mmap.  For GGML format, explicitly save and restore the offset.

Fixes #966.
convert.py