mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-18 00:35:04 +02:00
sd: sync to master-506-c9cd497 (#1991)
This commit is contained in:
@@ -919,15 +919,21 @@ std::vector<std::string> token_split(const std::string& text) {
|
||||
|
||||
// `\s*[\r\n]+|\s+(?!\S)|\s+`
|
||||
if (is_space(cp)) {
|
||||
std::string token = codepoint_to_utf8(cp);
|
||||
++i;
|
||||
std::string token;
|
||||
bool saw_new_line = false;
|
||||
|
||||
while (i < cps.size() && is_space(cps[i])) {
|
||||
token += codepoint_to_utf8(cps[i]);
|
||||
++i;
|
||||
|
||||
if (cps[i] == U'\r' || cps[i] == U'\n') {
|
||||
break;
|
||||
saw_new_line = true;
|
||||
} else {
|
||||
if (saw_new_line) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
tokens.push_back(token);
|
||||
|
||||
Reference in New Issue
Block a user