mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-01 06:14:35 +00:00
speculative : fix out-of-bounds access
This commit is contained in:
parent
af148c9386
commit
33bdee667e
@ -267,11 +267,12 @@ int main(int argc, char ** argv) {
|
|||||||
for (size_t i = 0; i < dist_tgt.size; i++) {
|
for (size_t i = 0; i < dist_tgt.size; i++) {
|
||||||
if (dist_tgt.data[i].id == drafts[s].tokens[i_dft]) {
|
if (dist_tgt.data[i].id == drafts[s].tokens[i_dft]) {
|
||||||
p_tgt = dist_tgt.data[i].p;
|
p_tgt = dist_tgt.data[i].p;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
for (size_t i = 0; i < dist_dft.size; i++) {
|
||||||
if (dist_dft.data[i].id == drafts[s].tokens[i_dft]) {
|
if (dist_dft.data[i].id == drafts[s].tokens[i_dft]) {
|
||||||
p_dft = dist_dft.data[i].p;
|
p_dft = dist_dft.data[i].p;
|
||||||
}
|
|
||||||
if (p_tgt && p_dft) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user