This commit is contained in:
Xuan Son Nguyen 2024-12-02 21:33:56 +01:00
parent 7bd044045f
commit 86ff8e3929

View file

@ -134,10 +134,11 @@ int main(void) {
int32_t res; int32_t res;
// list all supported templates // list all supported templates
std::vector<const char *> supported_tmpl(1024); std::vector<const char *> supported_tmpl;
res = llama_chat_builtin_templates(supported_tmpl.data(), supported_tmpl.size()); res = llama_chat_builtin_templates(nullptr, 0);
assert(res > 0); assert(res > 0);
supported_tmpl.resize(res); supported_tmpl.resize(res);
res = llama_chat_builtin_templates(supported_tmpl.data(), supported_tmpl.size());
printf("Built-in chat templates:\n"); printf("Built-in chat templates:\n");
for (auto tmpl : supported_tmpl) { for (auto tmpl : supported_tmpl) {
printf(" %s\n", tmpl); printf(" %s\n", tmpl);