Skip to content

Commit

Permalink
reserve canidates_grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusDunn committed Dec 4, 2023
1 parent 7cd0d32 commit eb9d1fc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7359,6 +7359,7 @@ void llama_sample_grammar(struct llama_context * ctx, llama_token_data_array * c
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;
candidates_grammar.reserve(candidates->size);

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

0 comments on commit eb9d1fc

Please sign in to comment.