mirror of
https://github.com/ikawrakow/ik_llama.cpp.git
synced 2026-08-12 22:29:39 +04:00
spec : disacard last drafted token with low prob (#1820)
* spec : disacard last drafted token with low prob * Apply suggestion from @ikawrakow Co-authored-by: Kawrakow <iwankawrakow@gmail.com> --------- Co-authored-by: firecoperana <firecoperana> Co-authored-by: Kawrakow <iwankawrakow@gmail.com>
This commit is contained in:
co-authored by
firecoperana <firecoperana>
Kawrakow
parent
f43a9f1cf6
commit
104846ddee
@@ -471,16 +471,20 @@ struct common_speculative_state_draft : public common_speculative_state {
|
||||
|
||||
common_sampler_accept(smpl, nullptr, id, true);
|
||||
|
||||
// only collect very high-confidence draft tokens
|
||||
if (cur_p->data[0].p < params.p_min) {
|
||||
if (i == 0) {
|
||||
result.push_back(id);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
result.push_back(id);
|
||||
|
||||
if (params.n_max <= (int) result.size()) {
|
||||
break;
|
||||
}
|
||||
|
||||
// only collect very high-confidence draft tokens
|
||||
if (cur_p->data[0].p < params.p_min) {
|
||||
break;
|
||||
}
|
||||
|
||||
common_batch_add(batch, id, n_past + i + 1, { 0 }, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user