[Frontend] structured decisions: noul and score question types (#60696)

Signed-off-by: Matt Mastracci <matthew@mastracci.com>
Co-authored-by: DeepSeek <noreply@deepseek.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Misha Goin <mgoin64@gmail.com>
This commit is contained in:
Matt Mastracci
2026-10-09 04:48:16 +00:00
committed by GitHub
co-authored by DeepSeek Claude Opus 5.5 Misha Goin
parent 88a419649e
commit 8cbd5d0300
6 changed files with 270 additions and 27 deletions
@@ -87,6 +87,9 @@ def test_labels_start_the_reply(qwen):
tail, ids = reply_label_ids(tokenizer, prompt_ids)
assert tokenizer.decode(tail) == "\n\n"
assert [tokenizer.decode([i]) for i in ids] == list(LABELS)
# A noul's and a score's labels are one token here too.
_, ids = reply_label_ids(tokenizer, prompt_ids, ("yes", "no", *"0123456789"))
assert len(set(ids)) == 12
# After a colon, Qwen writes ":A" as one token, so "A" is not one token.
with pytest.raises(ValueError, match="not one distinct token"):
reply_label_ids(tokenizer, tokenizer.encode("team:"))