From a843f1fac39acdd8575a698b0e5ec6a15694ae1b Mon Sep 17 00:00:00 2001 From: Gabe Goodhart Date: Tue, 24 Sep 2024 10:29:28 -0600 Subject: [PATCH] fix(granite): Add missing 'output' tensor for Granite This is a fix for the previous `granite` architecture PR. Recent snapshots have included this (`lm_head.weights`) as part of the architecture Branch: GraniteMoE Signed-off-by: Gabe Goodhart --- gguf-py/gguf/constants.py | 1 + src/llama.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/gguf-py/gguf/constants.py b/gguf-py/gguf/constants.py index bd83be1441d79..560eee916f27e 100644 --- a/gguf-py/gguf/constants.py +++ b/gguf-py/gguf/constants.py @@ -1234,6 +1234,7 @@ class MODEL_TENSOR(IntEnum): MODEL_ARCH.GRANITE: [ MODEL_TENSOR.TOKEN_EMBD, MODEL_TENSOR.OUTPUT_NORM, + MODEL_TENSOR.OUTPUT, MODEL_TENSOR.ATTN_NORM, MODEL_TENSOR.ATTN_Q, MODEL_TENSOR.ATTN_K, diff --git a/src/llama.cpp b/src/llama.cpp index f268dd91e30e4..0accb1492efaa 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -1469,6 +1469,7 @@ static const std::map> LLM_TENSOR_NA { { LLM_TENSOR_TOKEN_EMBD, "token_embd" }, { LLM_TENSOR_OUTPUT_NORM, "output_norm" }, + { LLM_TENSOR_OUTPUT, "output" }, { LLM_TENSOR_ATTN_NORM, "blk.%d.attn_norm" }, { LLM_TENSOR_ATTN_Q, "blk.%d.attn_q" }, { LLM_TENSOR_ATTN_K, "blk.%d.attn_k" },