[GW] Chat reliability: clean stop at end_message + debug instrumentation

In the plain-content path (effort none) the assistant channel closes at
<|end_message|> (200010); chat_turn now raises stop there so the reply is exactly
the content even when the trailing EOS is delayed by a near-tie (the model used
to emit unused special tokens past end_message and run to max_new). Live: the
one-word capital question now returns clean 'Paris' instead of 'Paris'+garbage.
Add VETTA_DBG_PROMPT (rendered prompt + ids) and VETTA_DBG_LOGITS (per-step top-5)
for parity bisection. chat_turn_paris GPU test green; workspace -D warnings green.
This commit is contained in:
adm committed 2026-12-01 17:43:03 +01:00
1 parent 74b3384270
commit cd853cda8b
2 files changed
+20

No files matched your search

+6
View File
@@ -229,6 +229,12 @@ pub fn serve_gen(
return;
}
let rep = sample_logits_exact(&mut lg, &opts, &history, None, &mut rng, &mut scratch);
if std::env::var("VETTA_DBG_LOGITS").is_ok() {
let mut idx: Vec<usize> = (0..eng.vocab).collect();
idx.sort_by(|&a, &b| lg[b].partial_cmp(&lg[a]).unwrap());
let top: Vec<(usize, f32)> = idx[..5].iter().map(|&i| (i, lg[i])).collect();
eprintln!("[dbg] step={step} pos={pos} top5={top:?}");
}
if rep.nonfinite_logits == eng.vocab {
finish = "nonfinite";
break;