File tree Expand file tree Collapse file tree 2 files changed +2
-10
lines changed
examples/models/llama2/runner Expand file tree Collapse file tree 2 files changed +2
-10
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;
Original file line number Diff line number Diff line change @@ -54,14 +54,12 @@ void check_embedding_byte_args(
54
54
if (weight_scales.dim () == 2 ) {
55
55
auto num_groups = weight_scales.size (1 );
56
56
auto remainder = weight.size (1 ) % num_groups;
57
- #if 0 // handle a partial last group
58
57
ET_CHECK_MSG (
59
58
remainder == 0 ,
60
59
" Number of groups must divide weight.size(1)=%zd"
61
60
" , but got # of groups = %zd" ,
62
61
weight.size (1 ),
63
62
num_groups);
64
- #endif // handle a partial last group
65
63
}
66
64
}
67
65
You can’t perform that action at this time.
0 commit comments