Skip to content

Commit 7cd0d32

Browse files
committed
reserve canidates_decoded
1 parent 5dd1f45 commit 7cd0d32

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llama.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7357,6 +7357,7 @@ void llama_sample_grammar(struct llama_context * ctx, llama_token_data_array * c
73577357
const llama_token eos = llama_token_eos(&ctx->model);
73587358

73597359
std::vector<std::pair<std::vector<uint32_t>, llama_partial_utf8>> candidates_decoded;
7360+
candidates_decoded.reserve(candidates->size);
73607361
std::vector<llama_grammar_candidate> candidates_grammar;
73617362

73627363
for (size_t i = 0; i < candidates->size; ++i) {

0 commit comments

Comments
 (0)