Conversation
|
@ochafik please check again |
ochafik
left a comment
There was a problem hiding this comment.
Hi @f291400 , thanks for opening this PR
The tests seem to cover something different than rsplit. Can you drop those changes and add a test for rsplit in test-syntax, and also mention in which template you've seen this? (if this unlock a new template, can you add it to the tested model ids in tests/CMakeLists.txt ?)
As for the thinking tests, I'm preparing an overhaul of thinking patterns in templates and their testing, stay tuned!
|
@ochafik Currently, none of the open-source large language models use |
|
Could you kindly review the current submission? |
|
@ochafik gentle ping |
| int splits = 0; | ||
| while (end != std::string::npos && (maxsplit < 0 || splits < maxsplit)) { | ||
| result.push_back(s.substr(start, end - start)); | ||
| start = end + sep.length(); | ||
| end = s.find(sep, start); | ||
| splits++; |
There was a problem hiding this comment.
| int splits = 0; | |
| while (end != std::string::npos && (maxsplit < 0 || splits < maxsplit)) { | |
| result.push_back(s.substr(start, end - start)); | |
| start = end + sep.length(); | |
| end = s.find(sep, start); | |
| splits++; | |
| while (end != std::string::npos && maxsplit != 0) { | |
| result.push_back(s.substr(start, end - start)); | |
| start = end + sep.length(); | |
| end = s.find(sep, start); | |
| --maxsplit; |
| int splits = 0; | ||
| while (pos != std::string::npos && (maxsplit < 0 || splits < maxsplit)) { | ||
| result.insert(result.begin(), s.substr(pos + sep.length(), end - pos - sep.length())); | ||
| end = pos; | ||
| splits++; | ||
| if (pos == 0) break; | ||
| pos = s.rfind(sep, pos - 1); | ||
| } | ||
| result.insert(result.begin(), s.substr(0, end)); |
There was a problem hiding this comment.
| int splits = 0; | |
| while (pos != std::string::npos && (maxsplit < 0 || splits < maxsplit)) { | |
| result.insert(result.begin(), s.substr(pos + sep.length(), end - pos - sep.length())); | |
| end = pos; | |
| splits++; | |
| if (pos == 0) break; | |
| pos = s.rfind(sep, pos - 1); | |
| } | |
| result.insert(result.begin(), s.substr(0, end)); | |
| while (pos != std::string::npos && maxsplit != 0) { | |
| result.push_back(s.substr(pos + sep.length(), end - pos - sep.length())); | |
| end = pos; | |
| --maxsplit; | |
| if (pos == 0) break; | |
| pos = s.rfind(sep, pos - 1); | |
| } | |
| result.push_back(s.substr(0, end)); | |
| std::reverse(result.begin(), result.end()); |
| auto charset = chars.empty() ? " \t\n\r" : chars; | ||
| auto start = left ? s.find_first_not_of(charset) : 0; | ||
| if (start == std::string::npos) return ""; | ||
| if (start == std::string::npos) return ""; |
There was a problem hiding this comment.
| if (start == std::string::npos) return ""; | |
| if (start == std::string::npos) return ""; |
No description provided.