Skip to content

Commit e75dfdd

Browse files
authored
sampling : null grammar field after reset (#3885)
1 parent 9a3b4f6 commit e75dfdd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: common/sampling.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ void llama_sampling_free(struct llama_sampling_context * ctx) {
3939
void llama_sampling_reset(llama_sampling_context * ctx) {
4040
if (ctx->grammar != NULL) {
4141
llama_grammar_free(ctx->grammar);
42+
ctx->grammar = NULL;
4243
}
4344

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

0 commit comments

Comments
 (0)