]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
sampling : null grammar field after reset (#3885)
authorl3utterfly <redacted>
Wed, 1 Nov 2023 13:40:43 +0000 (21:40 +0800)
committerGitHub <redacted>
Wed, 1 Nov 2023 13:40:43 +0000 (15:40 +0200)
common/sampling.cpp

index 673d67a6d5380e1cfe6bcb23fcbfb56d0d002cb7..1317024c2c11cffd9d05a8d8347b86f9064f3981 100644 (file)
@@ -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()) {