We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a58e1fc commit 103c840Copy full SHA for 103c840
common/chat.cpp
@@ -1448,8 +1448,12 @@ common_chat_params common_chat_templates_apply(
1448
content += part.text;
1449
}
1450
contents.emplace_back(std::move(content));
1451
- chat.push_back({msg.role.c_str(), contents.back().c_str()});
1452
- alloc_size += (msg.role.size() + contents.back().size()) * 1.25;
+ }
+ for (size_t i = 0; i < contents.size(); ++i) {
1453
+ const auto & msg = inputs.messages[i];
1454
+ const auto & content = contents[i];
1455
+ chat.push_back({msg.role.c_str(), content.c_str()});
1456
+ alloc_size += (msg.role.size() + content.size()) * 1.25;
1457
1458
1459
std::vector<char> buf(alloc_size);
0 commit comments