Skip to content

Commit 97366dc

Browse files
vocab : JetBrains Mellum pre-tokenizer (#15045)
1 parent 83bc2f2 commit 97366dc

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

convert_hf_to_gguf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,9 @@ def get_vocab_base_pre(self, tokenizer) -> str:
852852
if chkhsh == "2085e1638f6c377a0aa4ead21b27bb4cb941bf800df86ed391011769c1758dfb":
853853
# ref: https://huggingface.co/LGAI-EXAONE/EXAONE-4.0-32B
854854
res = "exaone4"
855+
if chkhsh == "a1e163ecab2e718a4c829d1148b6e86824ec36163bb71941c3dca9cd5ac25756":
856+
# ref: https://huggingface.co/JetBrains/Mellum-4b-base
857+
res = "mellum"
855858

856859
if res is None:
857860
logger.warning("\n")

convert_hf_to_gguf_update.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ class TOKENIZER_TYPE(IntEnum):
138138
{"name": "midm-2.0", "tokt": TOKENIZER_TYPE.BPE, "repo": "https://huggingface.co/K-intelligence/Midm-2.0-Base-Instruct", },
139139
{"name": "lfm2", "tokt": TOKENIZER_TYPE.BPE, "repo": "https://huggingface.co/LiquidAI/LFM2-Tokenizer"},
140140
{"name": "exaone4", "tokt": TOKENIZER_TYPE.BPE, "repo": "https://huggingface.co/LGAI-EXAONE/EXAONE-4.0-32B", },
141+
{"name": "mellum", "tokt": TOKENIZER_TYPE.BPE, "repo": "https://huggingface.co/JetBrains/Mellum-4b-base", },
141142
]
142143

143144
# some models are known to be broken upstream, so we will skip them as exceptions

src/llama-vocab.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,8 @@ void llama_vocab::impl::load(llama_model_loader & ml, const LLM_KV & kv) {
18561856
tokenizer_pre == "gigachat" ||
18571857
tokenizer_pre == "jina-v2-es" ||
18581858
tokenizer_pre == "jina-v2-de" ||
1859-
tokenizer_pre == "a.x-4.0") {
1859+
tokenizer_pre == "a.x-4.0" ||
1860+
tokenizer_pre == "mellum") {
18601861
pre_type = LLAMA_VOCAB_PRE_TYPE_GPT2;
18611862
} else if (
18621863
tokenizer_pre == "jina-v1-en" ||

0 commit comments

Comments
 (0)