check grammar in llama_sample_probability_distribution_impl
This commit is contained in:
parent
c76135401f
commit
45465b21d1
1 changed files with 5 additions and 0 deletions
|
@ -357,6 +357,11 @@ static llama_token_data_array llama_sample_probability_distribution_impl(
|
|||
}
|
||||
}
|
||||
|
||||
// apply grammar checks
|
||||
if (ctx_sampling->grammar != NULL) {
|
||||
llama_sample_grammar(ctx_main, &cur_p, ctx_sampling->grammar);
|
||||
}
|
||||
|
||||
llama_sample_softmax(ctx_main, &cur_p);
|
||||
return cur_p;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue