Explorar o código

sampling : null grammar field after reset (#3885)

l3utterfly %!s(int64=2) %!d(string=hai) anos
pai
achega
e75dfdd31b
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      common/sampling.cpp

+ 1 - 0
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()) {