]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
export-lora : use LLAMA_FILE_MAGIC_GGLA (#4894)
authorDaniel Bevenius <redacted>
Fri, 12 Jan 2024 17:54:53 +0000 (18:54 +0100)
committerGitHub <redacted>
Fri, 12 Jan 2024 17:54:53 +0000 (19:54 +0200)
This commit replaces the magic number used in export-lora.cpp with
the one defined in llama.h, which is indirectly included via common.h.

Signed-off-by: Daniel Bevenius <redacted>
examples/export-lora/export-lora.cpp

index 58fbe204d3bbbde40a8dbe43810bb8e64502bcb2..4cd5d99bb21ec5833f41ed1a7c0b3f17f0991412 100644 (file)
@@ -245,9 +245,8 @@ static struct lora_data * load_lora(struct lora_info * info) {
     params_ggml.no_alloc   = true;
     result->ctx = ggml_init(params_ggml);
 
-    uint32_t LLAMA_FILE_MAGIC_LORA = 0x67676C61; // 'ggla'
     uint32_t magic   = file.read_u32();
-    if (magic != LLAMA_FILE_MAGIC_LORA) {
+    if (magic != LLAMA_FILE_MAGIC_GGLA) {
         die_fmt("unexpected lora header file magic in '%s'", info->filename.c_str());
     }
     uint32_t version = file.read_u32();