Skip to content

Commit cc50356

Browse files
author
ochafik
committed
minja: fix vigogne (google/minja#22)
1 parent e3c475c commit cc50356

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

common/minja.hpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,12 +1305,10 @@ struct ArgumentsExpression {
13051305
};
13061306

13071307
static std::string strip(const std::string & s) {
1308-
static std::regex trailing_spaces_regex("^\\s+|\\s+$");
1309-
return std::regex_replace(s, trailing_spaces_regex, "");
1310-
// auto start = s.find_first_not_of(" \t\n\r");
1311-
// if (start == std::string::npos) return "";
1312-
// auto end = s.find_last_not_of(" \t\n\r");
1313-
// return s.substr(start, end - start + 1);
1308+
auto start = s.find_first_not_of(" \t\n\r");
1309+
if (start == std::string::npos) return "";
1310+
auto end = s.find_last_not_of(" \t\n\r");
1311+
return s.substr(start, end - start + 1);
13141312
}
13151313

13161314
static std::string html_escape(const std::string & s) {

tests/test-chat-template.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ int main(void) {
6868
/* .expected_output_jinja= */ "[INST] <<SYS>>\nYou are a helpful assistant\n<</SYS>>\n\nHello [/INST] Hi there </s>[INST] Who are you [/INST] I am an assistant </s>[INST] Another question [/INST]",
6969
/* .bos_token= */ "",
7070
/* .eos_token= */ "</s>",
71-
/* .supported_with_jinja= */ false, // Mysteriously fails on windows-latest in llama.cpp's CI, although that template works fine in Minja's CI on windows-latest
7271
},
7372
{
7473
/* .name= */ "mlabonne/AlphaMonarch-7B",

0 commit comments

Comments
 (0)