speculative : fix seg fault in certain cases (#12454)

This commit is contained in:
Georgi Gerganov 2025-03-18 19:35:11 +02:00 committed by GitHub
parent 99aa304fb9
commit c6af2161b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -331,11 +331,11 @@ int main(int argc, char ** argv) {
}
active_seqs.erase(s);
for(int i = 0; i < n_seq_dft; i++) {
for (int i = 0; i < n_seq_dft; i++) {
if (i == s) {
continue;
}
if (drafts[i].tokens[i_dft] == drafts[s].tokens[i_dft]) {
if (drafts[i].active && drafts[i].tokens[i_dft] == drafts[s].tokens[i_dft]) {
// synchronize active status for sequences with the same drafted token
drafts[i].active = drafts[i].active && accept;
if (!drafts[i].active) {