@@ -15,14 +15,16 @@ namespace ctranslate2 {
15
15
std::vector<std::vector<size_t >> hypotheses;
16
16
std::vector<float > scores;
17
17
std::vector<std::vector<std::vector<float >>> attention;
18
+ std::vector<std::vector<StorageView>> log_probs_vocab;
18
19
};
19
20
20
21
struct DecodingStepResult {
21
22
size_t step;
22
23
size_t batch_id;
23
24
size_t token_id;
24
25
size_t hypothesis_id;
25
- std::optional<float > log_prob;
26
+ std::optional<float > score;
27
+ std::optional<StorageView> log_probs;
26
28
bool is_last = false ;
27
29
};
28
30
@@ -41,6 +43,7 @@ namespace ctranslate2 {
41
43
const dim_t min_length,
42
44
const bool return_scores = false ,
43
45
const bool return_attention = false ,
46
+ const bool return_log_probs_vocab = true ,
44
47
const bool return_prefix = true ,
45
48
const size_t num_hypotheses = 1 ,
46
49
const bool include_eos_in_hypotheses = true ,
@@ -67,6 +70,7 @@ namespace ctranslate2 {
67
70
const dim_t min_length,
68
71
const bool return_scores = false ,
69
72
const bool return_attention = false ,
73
+ const bool return_log_probs_vocab = true ,
70
74
const bool return_prefix = true ,
71
75
const size_t num_hypotheses = 1 ,
72
76
const bool include_eos_in_hypotheses = true ,
@@ -118,6 +122,7 @@ namespace ctranslate2 {
118
122
const dim_t min_length,
119
123
const bool return_scores = false ,
120
124
const bool return_attention = false ,
125
+ const bool return_log_probs_vocab = true ,
121
126
const bool return_prefix = true ,
122
127
const size_t num_hypotheses = 1 ,
123
128
const bool include_eos_in_hypotheses = true ,
@@ -149,6 +154,7 @@ namespace ctranslate2 {
149
154
bool include_eos_in_hypotheses = true ;
150
155
bool return_scores = false ;
151
156
bool return_attention = false ;
157
+ bool return_log_probs_vocab = false ;
152
158
bool return_alternatives = false ;
153
159
bool return_prefix = true ;
154
160
float min_alternative_expansion_prob = 0 ;
0 commit comments