@@ -15,14 +15,16 @@ namespace ctranslate2 {
1515 std::vector<std::vector<size_t >> hypotheses;
1616 std::vector<float > scores;
1717 std::vector<std::vector<std::vector<float >>> attention;
18+ std::vector<std::vector<StorageView>> logits_vocab;
1819 };
1920
2021 struct DecodingStepResult {
2122 size_t step;
2223 size_t batch_id;
2324 size_t token_id;
2425 size_t hypothesis_id;
25- std::optional<float > log_prob;
26+ std::optional<float > score;
27+ std::optional<StorageView> logits;
2628 bool is_last = false ;
2729 };
2830
@@ -41,6 +43,7 @@ namespace ctranslate2 {
4143 const dim_t min_length,
4244 const bool return_scores = false ,
4345 const bool return_attention = false ,
46+ const bool return_logits_vocab = true ,
4447 const bool return_prefix = true ,
4548 const size_t num_hypotheses = 1 ,
4649 const bool include_eos_in_hypotheses = true ,
@@ -67,6 +70,7 @@ namespace ctranslate2 {
6770 const dim_t min_length,
6871 const bool return_scores = false ,
6972 const bool return_attention = false ,
73+ const bool return_logits_vocab = true ,
7074 const bool return_prefix = true ,
7175 const size_t num_hypotheses = 1 ,
7276 const bool include_eos_in_hypotheses = true ,
@@ -118,6 +122,7 @@ namespace ctranslate2 {
118122 const dim_t min_length,
119123 const bool return_scores = false ,
120124 const bool return_attention = false ,
125+ const bool return_logits_vocab = true ,
121126 const bool return_prefix = true ,
122127 const size_t num_hypotheses = 1 ,
123128 const bool include_eos_in_hypotheses = true ,
@@ -149,6 +154,7 @@ namespace ctranslate2 {
149154 bool include_eos_in_hypotheses = true ;
150155 bool return_scores = false ;
151156 bool return_attention = false ;
157+ bool return_logits_vocab = false ;
152158 bool return_alternatives = false ;
153159 bool return_prefix = true ;
154160 float min_alternative_expansion_prob = 0 ;
0 commit comments