"megatron/legacy/data/ict_dataset.py" did not exist on "7a348580786a9fb4c37b24a606f28df76dd2592c"
05-default-pretokenizer.diff 1.9 KB
Newer Older
1
diff --git a/src/llama.cpp b/src/llama.cpp
2
index 88355971..dd7d41ed 100644
3
4
--- a/src/llama.cpp
+++ b/src/llama.cpp
5
@@ -6083,16 +6083,7 @@ static void llm_load_vocab(
6
         if (vocab.type == LLAMA_VOCAB_TYPE_BPE) {
7
8
             vocab.tokenizer_add_space_prefix = false;
             vocab.tokenizer_clean_spaces = true;
9
10
11
12
13
14
15
16
-            if (tokenizer_pre.empty()) {
-                LLAMA_LOG_WARN("%s: missing pre-tokenizer type, using: 'default'\n", __func__);
-                LLAMA_LOG_WARN("%s:                                             \n", __func__);
-                LLAMA_LOG_WARN("%s: ************************************        \n", __func__);
-                LLAMA_LOG_WARN("%s: GENERATION QUALITY WILL BE DEGRADED!        \n", __func__);
-                LLAMA_LOG_WARN("%s: CONSIDER REGENERATING THE MODEL             \n", __func__);
-                LLAMA_LOG_WARN("%s: ************************************        \n", __func__);
-                LLAMA_LOG_WARN("%s:                                             \n", __func__);
Michael Yang's avatar
Michael Yang committed
17
-                vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DEFAULT;
18
19
-            } else if (tokenizer_pre == "default") {
+            if (tokenizer_pre == "default") {
20
                 vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DEFAULT;
Michael Yang's avatar
Michael Yang committed
21
             } else if (
22
                     tokenizer_pre == "llama3"   ||
23
24
25
@@ -6188,7 +6179,8 @@ static void llm_load_vocab(
                 tokenizer_pre == "exaone") {
                 vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_EXAONE;
Michael Yang's avatar
Michael Yang committed
26
27
             } else {
-                throw std::runtime_error(format("unknown pre-tokenizer type: '%s'", tokenizer_pre.c_str()));
28
+                LLAMA_LOG_WARN("%s: missing or unrecognized pre-tokenizer type, using: 'default'\n", __func__);
Michael Yang's avatar
Michael Yang committed
29
30
+                vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DEFAULT;
             }
31
         } else if (vocab.type == LLAMA_VOCAB_TYPE_SPM) {
Michael Yang's avatar
Michael Yang committed
32
             vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DEFAULT;