diff --git a/llama.cpp b/llama.cpp index c16819a48bad8..99b5c5b392e09 100644 --- a/llama.cpp +++ b/llama.cpp @@ -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, llama_partial_utf8>> candidates_decoded; + candidates_decoded.reserve(candidates->size); std::vector candidates_grammar; for (size_t i = 0; i < candidates->size; ++i) {