spec : fix n-gram drafts rejected at temp > 0 after truncation (#29924)

Co-authored-by: Pranesh Gonegandla <pgonegandla@nvidia.com>
This commit is contained in:
Pranesh GonegandlaandPranesh Gonegandla authored and GitHub committed 2026-10-04 11:45:22 +03:00
1 parent 6716df694b
commit 8330e96967
1 file changed
+2 -2
+2 -2
View File
@@ -2915,8 +2915,8 @@ void common_speculative_draft(common_speculative * spec) {
SPC_DBG("truncating draft to %d tokens\n", dp.n_max);
result.resize(dp.n_max);
// the candidates are one per drafted token and must be cut with them
if (dp.result_q) {
// trim the candidates only if the drafter produced them (n-gram drafters do not)
if (dp.result_q && !dp.result_q->empty()) {
dp.result_q->resize(dp.n_max);
}
}