reserve canidates_decoded

This commit is contained in:
marcus 2023-12-04 14:09:49 -08:00
parent 5dd1f45e1d
commit 7cd0d3232f

View File

@ -7357,6 +7357,7 @@ void llama_sample_grammar(struct llama_context * ctx, llama_token_data_array * c
const llama_token eos = llama_token_eos(&ctx->model);
std::vector<std::pair<std::vector<uint32_t>, llama_partial_utf8>> candidates_decoded;
candidates_decoded.reserve(candidates->size);
std::vector<llama_grammar_candidate> candidates_grammar;
for (size_t i = 0; i < candidates->size; ++i) {