]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama : fix regression from #2000 - could not load no-mmap models
authorGeorgi Gerganov <redacted>
Thu, 20 Jul 2023 10:47:26 +0000 (13:47 +0300)
committerGeorgi Gerganov <redacted>
Thu, 20 Jul 2023 10:47:26 +0000 (13:47 +0300)
llama.cpp

index 3319b7023ee5f725fa1016c5902d731ed92a6d44..796dfdacbc34e8351a1fde5d7024c3c18ab428c9 100644 (file)
--- a/llama.cpp
+++ b/llama.cpp
@@ -555,7 +555,9 @@ struct llama_file_loader {
             }
 
             // skip to the next multiple of 32 bytes
-            file.seek(-static_cast<ptrdiff_t>(file.tell()) & 31, SEEK_CUR);
+            if (file_version >= LLAMA_FILE_VERSION_GGJT_V1) {
+                file.seek(-static_cast<ptrdiff_t>(file.tell()) & 31, SEEK_CUR);
+            }
 
             tensor.file_off = file.tell();
             tensor.name = name;