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 {
162
162
return seq[i].test (seq_id);
163
163
}
164
164
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) {
167
167
assert (i < pos.size ());
168
168
assert (pos[i] != -1 );
169
+ assert (!seq[i].test (seq_id));
169
170
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);
179
172
}
180
173
181
174
// note: call only if the cell is not empty
@@ -252,7 +245,7 @@ class llama_kv_cells_unified {
252
245
}
253
246
254
247
private:
255
- uint32_t used = 0 ; // used cells (i.e. at least one seq_id )
248
+ uint32_t used = 0 ; // used cells (i.e. at pos[i] != -1, allowd to not have any sequence )
256
249
257
250
bool has_shift = false ;
258
251
You can’t perform that action at this time.
0 commit comments