From 70af98bc921b114139cf9c1eb129bd7393d6bdd7 Mon Sep 17 00:00:00 2001 From: Elijah Rippeth Date: Mon, 23 Feb 2026 22:25:34 +0000 Subject: [PATCH] Fix index calculation for logits_vocab Attempts to fix issue with empty logits vector when beam_size > 1. --- src/decoding.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/decoding.cc b/src/decoding.cc index 84f39ac37..8dd215ef3 100644 --- a/src/decoding.cc +++ b/src/decoding.cc @@ -631,7 +631,7 @@ namespace ctranslate2 { if (alive_attention) result.attention.emplace_back(build_attention(alive_attention, i, k, start, end)); if (return_logits_vocab) { - result.logits_vocab.emplace_back(std::move(logits_vec[i * k])); + result.logits_vocab.emplace_back(std::move(logits_vec[i * _beam_size + k])); } // Move another active beam to this position.