From 86ff8e39294733752d08ff64a04aac6b80b66005 Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Mon, 2 Dec 2024 21:33:56 +0100 Subject: [PATCH] fix test --- tests/test-chat-template.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test-chat-template.cpp b/tests/test-chat-template.cpp index bc4a34856..aa140b569 100644 --- a/tests/test-chat-template.cpp +++ b/tests/test-chat-template.cpp @@ -134,10 +134,11 @@ int main(void) { int32_t res; // list all supported templates - std::vector supported_tmpl(1024); - res = llama_chat_builtin_templates(supported_tmpl.data(), supported_tmpl.size()); + std::vector supported_tmpl; + res = llama_chat_builtin_templates(nullptr, 0); assert(res > 0); supported_tmpl.resize(res); + res = llama_chat_builtin_templates(supported_tmpl.data(), supported_tmpl.size()); printf("Built-in chat templates:\n"); for (auto tmpl : supported_tmpl) { printf(" %s\n", tmpl);