From: l3utterfly Date: Wed, 1 Nov 2023 13:40:43 +0000 (+0800) Subject: sampling : null grammar field after reset (#3885) X-Git-Tag: upstream/0.0.4488~3033 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=e75dfdd31b6a3dfa0627ba4ac3bb4b36e9db588e;p=pkg%2Fggml%2Fsources%2Fllama.cpp sampling : null grammar field after reset (#3885) --- diff --git a/common/sampling.cpp b/common/sampling.cpp index 673d67a6..1317024c 100644 --- a/common/sampling.cpp +++ b/common/sampling.cpp @@ -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()) {