Explorar o código

llama : fix regression from #2000 - could not load no-mmap models

Georgi Gerganov %!s(int64=2) %!d(string=hai) anos
pai
achega
fff0e0eafe
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      llama.cpp

+ 3 - 1
llama.cpp

@@ -555,7 +555,9 @@ struct llama_file_loader {
             }
             }
 
 
             // skip to the next multiple of 32 bytes
             // 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.file_off = file.tell();
             tensor.name = name;
             tensor.name = name;