Skip to content

Commit 31cc6df

Browse files
author
Olivier Chafik
committed
Update sampling.cpp
1 parent 0a2ce59 commit 31cc6df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/sampling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static llama_token llama_sampling_sample_impl(
191191

192192
std::vector<float> original_logits;
193193
auto cur_p = llama_sampling_prepare(ctx_sampling, ctx_main, ctx_cfg, idx, /* apply_grammar= */ is_resampling, &original_logits);
194-
if (!is_resampling) {
194+
if (ctx_sampling->grammar != NULL && !is_resampling) {
195195
GGML_ASSERT(!original_logits.empty());
196196
}
197197
llama_token id = 0;

0 commit comments

Comments
 (0)