]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
vocab : BailingMoE : change possessive quantifiers to greedy (#12677)
authorSigbjørn Skjæret <redacted>
Wed, 2 Apr 2025 09:21:48 +0000 (11:21 +0200)
committerGitHub <redacted>
Wed, 2 Apr 2025 09:21:48 +0000 (11:21 +0200)
src/llama-vocab.cpp

index 31e2055f83611e4963281dba57c7887c39c14ede..521a6ec5edbc95fc4be54831a82905e7c4cfc762 100644 (file)
@@ -411,7 +411,8 @@ struct llm_tokenizer_bpe : llm_tokenizer {
                 regex_exprs = {
                     // original regex from tokenizer.json
                     // "'(?i:[sdmt]|ll|ve|re)|[^\\r\\n\\p{L}\\p{N}]?+\\p{L}+|\\p{N}| ?[^\\s\\p{L}\\p{N}]++[\\r\\n]*|\\s*[\\r\\n]|\\s+(?!\\S)|\\s+"
-                    "'(?:[sSdDmMtT]|[lL][lL]|[vV][eE]|[rR][eE])|[^\\r\\n\\p{L}\\p{N}]?+\\p{L}+|\\p{N}| ?[^\\s\\p{L}\\p{N}]++[\\r\\n]*|\\s*[\\r\\n]|\\s+(?!\\S)|\\s+",
+                    // FIXME? Changed possessive quantifiers (?+ and ++) to greedy to avoid errors and imatrix hanging (tried atomic grouping but it's not supported?)
+                    "'(?:[sSdDmMtT]|[lL][lL]|[vV][eE]|[rR][eE])|[^\\r\\n\\p{L}\\p{N}]?\\p{L}+|\\p{N}| ?[^\\s\\p{L}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]|\\s+(?!\\S)|\\s+",
                 };
                 break;
             default: