Skip to content

Commit 25f3380

Browse files
committed
sampling : add debug log when backend sampler selects token
This commit adds a debug log statement in the llama_sampler_sample to indicate when a backend sampler has selected a token for a given index. The modification helps in tracing the sampling process and understanding the flow of control when backend samplers are used.
1 parent 8eb9b47 commit 25f3380

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/llama-sampling.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ llama_token llama_sampler_sample(struct llama_sampler * smpl, struct llama_conte
446446

447447
// If a backend sampler has already sampled a token, return it.
448448
if (sampled_token != LLAMA_TOKEN_NULL) {
449+
LLAMA_LOG_DEBUG("%s: Backend sampler selected token for idx %d. Skipping CPU samplers\n", __func__, idx);
449450
return sampled_token;
450451
}
451452

0 commit comments

Comments
 (0)