llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

convert.py: Fix loading safetensors and ggml format on Windows

Open comex opened this issue 1 year ago • 0 comments

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.

comex avatar Apr 15 '23 02:04 comex