Skip to content

Commit 86ff8e3

Browse files
committed
fix test
1 parent 7bd0440 commit 86ff8e3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test-chat-template.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@ int main(void) {
134134
int32_t res;
135135

136136
// list all supported templates
137-
std::vector<const char *> supported_tmpl(1024);
138-
res = llama_chat_builtin_templates(supported_tmpl.data(), supported_tmpl.size());
137+
std::vector<const char *> supported_tmpl;
138+
res = llama_chat_builtin_templates(nullptr, 0);
139139
assert(res > 0);
140140
supported_tmpl.resize(res);
141+
res = llama_chat_builtin_templates(supported_tmpl.data(), supported_tmpl.size());
141142
printf("Built-in chat templates:\n");
142143
for (auto tmpl : supported_tmpl) {
143144
printf(" %s\n", tmpl);

0 commit comments

Comments
 (0)