File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
examples/models/llama2/runner Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,6 @@ Error Runner::generate(
197
197
int next; // will store the next token in the sequence
198
198
int64_t pos = num_prompt_tokens - 1 ; // position in the sequence
199
199
int token = prompt_tokens[pos]; // prefill starts from 0 to num_prompt_tokens
200
- int eos_counter = 0 ; // counter to capture EOS
201
200
int logits_index = 0 ; // index of the logits tensor in the output
202
201
int k_cache_index = 0 ;
203
202
int v_cache_index = 0 ;
@@ -340,13 +339,8 @@ Error Runner::generate(
340
339
341
340
// data-dependent terminating condition: we have n_eos_ number of EOS
342
341
if (pos >= num_prompt_tokens && next == eos_id_) {
343
- eos_counter++;
344
- if (eos_counter == n_eos_) {
345
- ET_LOG (Info, " Reached to the end of generation" );
346
- break ;
347
- }
348
- } else {
349
- eos_counter = 0 ;
342
+ ET_LOG (Info, " Reached to the end of generation" );
343
+ break ;
350
344
}
351
345
352
346
token = next;
You can’t perform that action at this time.
0 commit comments