Skip to content

Commit eb9d1fc

Browse files
committed
reserve canidates_grammar
1 parent 7cd0d32 commit eb9d1fc

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
@@ -7359,6 +7359,7 @@ void llama_sample_grammar(struct llama_context * ctx, llama_token_data_array * c
73597359
std::vector<std::pair<std::vector<uint32_t>, llama_partial_utf8>> candidates_decoded;
73607360
candidates_decoded.reserve(candidates->size);
73617361
std::vector<llama_grammar_candidate> candidates_grammar;
7362+
candidates_grammar.reserve(candidates->size);
73627363

73637364
for (size_t i = 0; i < candidates->size; ++i) {
73647365
const llama_token id = candidates->data[i].id;

0 commit comments

Comments
 (0)