Skip to content

Commit a820a9e

Browse files
NoedaMinh141120
authored andcommitted
model : add dots.llm1 architecture support (ggml-org#14044) (ggml-org#14118)
Adds: * Dots1Model to convert_hf_to_gguf.py * Computation graph code to llama-model.cpp * Chat template to llama-chat.cpp to detect this model's template. --- The model is called "dots.llm1" (I decided to shorten it to dots1 or DOTS1 in the code generally) architecture. The only models that exist as of writing of this commit that follow this architecture are "dots.llm1.inst" and "dots.llm1.base" from here: * https://huggingface.co/rednote-hilab/dots.llm1.inst * https://huggingface.co/rednote-hilab/dots.llm1.base The model architecture is a combination of Qwen and Deepseek parts, as seen here: https://github.com/huggingface/transformers/blob/ffe12627b4e84489d2ab91dd0ec00614855edc79/src/transformers/models/dots1/modular_dots1.py
1 parent d406c39 commit a820a9e

File tree

4 files changed

+4
-404
lines changed

4 files changed

+4
-404
lines changed

gguf-py/gguf/constants.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,6 @@ class MODEL_ARCH(IntEnum):
353353
PLM = auto()
354354
BAILINGMOE = auto()
355355
DOTS1 = auto()
356-
ARCEE = auto()
357-
ERNIE4_5 = auto()
358356

359357

360358
class VISION_PROJECTOR_TYPE(IntEnum):
@@ -653,9 +651,7 @@ class MODEL_TENSOR(IntEnum):
653651
MODEL_ARCH.WAVTOKENIZER_DEC: "wavtokenizer-dec",
654652
MODEL_ARCH.PLM: "plm",
655653
MODEL_ARCH.BAILINGMOE: "bailingmoe",
656-
MODEL_ARCH.DOTS1: "dots1",
657-
MODEL_ARCH.ARCEE: "arcee",
658-
MODEL_ARCH.ERNIE4_5: "ernie4_5",
654+
MODEL_ARCH.DOTS1: "dots1"
659655
}
660656

661657
VISION_PROJECTOR_TYPE_NAMES: dict[VISION_PROJECTOR_TYPE, str] = {
@@ -2164,35 +2160,6 @@ class MODEL_TENSOR(IntEnum):
21642160
MODEL_TENSOR.FFN_UP_EXP,
21652161
MODEL_TENSOR.FFN_UP_SHEXP,
21662162
],
2167-
MODEL_ARCH.ARCEE: [
2168-
MODEL_TENSOR.TOKEN_EMBD,
2169-
MODEL_TENSOR.OUTPUT_NORM,
2170-
MODEL_TENSOR.OUTPUT,
2171-
MODEL_TENSOR.ROPE_FREQS,
2172-
MODEL_TENSOR.ATTN_NORM,
2173-
MODEL_TENSOR.ATTN_Q,
2174-
MODEL_TENSOR.ATTN_K,
2175-
MODEL_TENSOR.ATTN_V,
2176-
MODEL_TENSOR.ATTN_OUT,
2177-
MODEL_TENSOR.ATTN_ROT_EMBD,
2178-
MODEL_TENSOR.FFN_NORM,
2179-
MODEL_TENSOR.FFN_DOWN,
2180-
MODEL_TENSOR.FFN_UP,
2181-
],
2182-
MODEL_ARCH.ERNIE4_5: [
2183-
MODEL_TENSOR.TOKEN_EMBD,
2184-
MODEL_TENSOR.OUTPUT_NORM,
2185-
MODEL_TENSOR.OUTPUT,
2186-
MODEL_TENSOR.ATTN_NORM,
2187-
MODEL_TENSOR.ATTN_Q,
2188-
MODEL_TENSOR.ATTN_K,
2189-
MODEL_TENSOR.ATTN_V,
2190-
MODEL_TENSOR.ATTN_OUT,
2191-
MODEL_TENSOR.FFN_NORM,
2192-
MODEL_TENSOR.FFN_GATE,
2193-
MODEL_TENSOR.FFN_DOWN,
2194-
MODEL_TENSOR.FFN_UP,
2195-
],
21962163
# TODO
21972164
}
21982165

src/llama-arch.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ static const std::map<llm_arch, const char *> LLM_ARCH_NAMES = {
7575
{ LLM_ARCH_PLM, "plm" },
7676
{ LLM_ARCH_BAILINGMOE, "bailingmoe" },
7777
{ LLM_ARCH_DOTS1, "dots1" },
78-
{ LLM_ARCH_ARCEE, "arcee" },
79-
{ LLM_ARCH_ERNIE4_5, "ernie4_5" },
8078
{ LLM_ARCH_UNKNOWN, "(unknown)" },
8179
};
8280

@@ -1659,23 +1657,6 @@ static const std::map<llm_arch, std::map<llm_tensor, const char *>> LLM_TENSOR_N
16591657
{ LLM_TENSOR_FFN_EXP_PROBS_B, "blk.%d.exp_probs_b" },
16601658
}
16611659
},
1662-
{
1663-
LLM_ARCH_ERNIE4_5,
1664-
{
1665-
{ LLM_TENSOR_TOKEN_EMBD, "token_embd" },
1666-
{ LLM_TENSOR_OUTPUT_NORM, "output_norm" },
1667-
{ LLM_TENSOR_OUTPUT, "output" },
1668-
{ LLM_TENSOR_ATTN_NORM, "blk.%d.attn_norm" },
1669-
{ LLM_TENSOR_ATTN_Q, "blk.%d.attn_q" },
1670-
{ LLM_TENSOR_ATTN_K, "blk.%d.attn_k" },
1671-
{ LLM_TENSOR_ATTN_V, "blk.%d.attn_v" },
1672-
{ LLM_TENSOR_ATTN_OUT, "blk.%d.attn_output" },
1673-
{ LLM_TENSOR_FFN_NORM, "blk.%d.ffn_norm" },
1674-
{ LLM_TENSOR_FFN_GATE, "blk.%d.ffn_gate" },
1675-
{ LLM_TENSOR_FFN_DOWN, "blk.%d.ffn_down" },
1676-
{ LLM_TENSOR_FFN_UP, "blk.%d.ffn_up" },
1677-
},
1678-
},
16791660
{
16801661
LLM_ARCH_UNKNOWN,
16811662
{

src/llama-arch.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ enum llm_arch {
7979
LLM_ARCH_PLM,
8080
LLM_ARCH_BAILINGMOE,
8181
LLM_ARCH_DOTS1,
82-
LLM_ARCH_ARCEE,
83-
LLM_ARCH_ERNIE4_5,
8482
LLM_ARCH_UNKNOWN,
8583
};
8684

0 commit comments

Comments
 (0)