summaryrefslogtreecommitdiff
path: root/llama.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llama.cpp')
-rw-r--r--llama.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llama.cpp b/llama.cpp
index 225ea977..7f8c259a 100644
--- a/llama.cpp
+++ b/llama.cpp
@@ -4713,6 +4713,9 @@ static void llm_load_vocab(
} else if (
tokenizer_pre == "smaug-bpe") {
vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_SMAUG;
+ } else if (
+ tokenizer_pre == "poro-chat") {
+ vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_PORO;
} else {
throw std::runtime_error(format("unknown pre-tokenizer type: '%s'", tokenizer_pre.c_str()));
}
@@ -13028,6 +13031,11 @@ struct llm_tokenizer_bpe {
"(?:'[sS]|'[tT]|'[rR][eE]|'[vV][eE]|'[mM]|'[lL][lL]|'[dD])|[^\\r\\n\\p{L}\\p{N}]?\\p{L}+|\\p{N}| ?[^\\s\\p{L}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
});
break;
+ case LLAMA_VOCAB_PRE_TYPE_PORO:
+ word_collection = unicode_regex_split(text, {
+ " ?[^(\\s|.,!?…。,、।۔،)]+",
+ });
+ break;
default:
// default regex for BPE tokenization pre-processing
word_collection = unicode_regex_split(text, {