File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -162,20 +162,13 @@ class llama_kv_cells_unified {
162162 return seq[i].test (seq_id);
163163 }
164164
165- // note: call only if the cell is not empty
166- bool seq_add (uint32_t i, llama_seq_id seq_id) {
165+ // note: call only if the cell is not empty and the seq_id is not in the cell
166+ void seq_add (uint32_t i, llama_seq_id seq_id) {
167167 assert (i < pos.size ());
168168 assert (pos[i] != -1 );
169+ assert (!seq[i].test (seq_id));
169170
170- if (seq[i].none ()) {
171- seq[i].set (seq_id);
172-
173- used++;
174-
175- return true ;
176- }
177-
178- return false ;
171+ seq[i].set (seq_id);
179172 }
180173
181174 // note: call only if the cell is not empty
@@ -252,7 +245,7 @@ class llama_kv_cells_unified {
252245 }
253246
254247private:
255- uint32_t used = 0 ; // used cells (i.e. at least one seq_id)
248+ uint32_t used = 0 ; // used cells (i.e. pos[i] != -1, allowed to not have any seq_id)
256249
257250 bool has_shift = false ;
258251
You can’t perform that action at this time.
0 commit comments