Skip to content

Commit c429b33

Browse files
llama : add Smaug 70B support (#7402)
1 parent 9146d36 commit c429b33

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

convert-hf-to-gguf-update.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ class TOKENIZER_TYPE(IntEnum):
8181
{"name": "jina-v2-en", "tokt": TOKENIZER_TYPE.WPM, "repo": "https://huggingface.co/jinaai/jina-embeddings-v2-base-en", }, # WPM!
8282
{"name": "jina-v2-es", "tokt": TOKENIZER_TYPE.BPE, "repo": "https://huggingface.co/jinaai/jina-embeddings-v2-base-es", },
8383
{"name": "jina-v2-de", "tokt": TOKENIZER_TYPE.BPE, "repo": "https://huggingface.co/jinaai/jina-embeddings-v2-base-de", },
84+
{"name": "smaug-bpe", "tokt": TOKENIZER_TYPE.BPE, "repo": "https://huggingface.co/abacusai/Smaug-Llama-3-70B-Instruct", },
8485
]
8586

8687

convert-hf-to-gguf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,9 @@ def get_vocab_base_pre(self, tokenizer) -> str:
473473
if chkhsh == "27949a2493fc4a9f53f5b9b029c82689cfbe5d3a1929bb25e043089e28466de6":
474474
# ref: https://huggingface.co/jinaai/jina-embeddings-v2-base-de
475475
res = "jina-v2-de"
476+
if chkhsh == "c136ed14d01c2745d4f60a9596ae66800e2b61fa45643e72436041855ad4089d":
477+
# ref: https://huggingface.co/abacusai/Smaug-Llama-3-70B-Instruct
478+
res = "smaug-bpe"
476479

477480
if res is None:
478481
logger.warning("\n")

llama.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4593,6 +4593,9 @@ static void llm_load_vocab(
45934593
} else if (
45944594
tokenizer_pre == "dbrx") {
45954595
vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DBRX;
4596+
} else if (
4597+
tokenizer_pre == "smaug-bpe") {
4598+
vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_SMAUG;
45964599
} else {
45974600
throw std::runtime_error(format("unknown pre-tokenizer type: '%s'", tokenizer_pre.c_str()));
45984601
}
@@ -12512,6 +12515,7 @@ struct llm_tokenizer_bpe {
1251212515
});
1251312516
break;
1251412517
case LLAMA_VOCAB_PRE_TYPE_DBRX:
12518+
case LLAMA_VOCAB_PRE_TYPE_SMAUG:
1251512519
word_collection = unicode_regex_split(text, {
1251612520
// same as llama3
1251712521
"(?:'[sS]|'[tT]|'[rR][eE]|'[vV][eE]|'[mM]|'[lL][lL]|'[dD])|[^\\r\\n\\p{L}\\p{N}]?\\p{L}+|\\p{N}{1,3}| ?[^\\s\\p{L}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",

llama.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ extern "C" {
8585
LLAMA_VOCAB_PRE_TYPE_QWEN2 = 11,
8686
LLAMA_VOCAB_PRE_TYPE_OLMO = 12,
8787
LLAMA_VOCAB_PRE_TYPE_DBRX = 13,
88+
LLAMA_VOCAB_PRE_TYPE_SMAUG = 14,
8889
};
8990

9091
// note: these values should be synchronized with ggml_rope

0 commit comments

Comments
 (0)