Skip to content

Commit

Permalink
null grammar field after reset
Browse files Browse the repository at this point in the history
  • Loading branch information
l3utterfly committed Nov 1, 2023
1 parent 238657d commit 524c6ca
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions common/sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ void llama_sampling_free(struct llama_sampling_context * ctx) {
void llama_sampling_reset(llama_sampling_context * ctx) {
if (ctx->grammar != NULL) {
llama_grammar_free(ctx->grammar);
ctx->grammar = NULL;
}

if (!ctx->parsed_grammar.rules.empty()) {
Expand Down

0 comments on commit 524c6ca

Please sign in to comment.