Skip to content

Commit

Permalink
Skip callback for prefix tokens with include_prompt_in_result=False (O…
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumekln authored Apr 21, 2023
1 parent b14092f commit ba3b77c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/decoding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ namespace ctranslate2 {
const bool is_finished = ((is_eos(word_id, end_ids) && step >= prefix_length)
|| (step + 1 == max_length));

if (_callback) {
if (_callback && (return_prefix || step >= prefix_length)) {
DecodingStepResult step_result;
step_result.step = step;
step_result.batch_id = batch_id;
Expand Down

0 comments on commit ba3b77c

Please sign in to comment.