diff --git a/TODO b/TODO index 63768b4..ada5ac5 100644 --- a/TODO +++ b/TODO @@ -271,3 +271,26 @@ Description: build_masked_example assumed apply_chat_template returns a flat the result is dict-like, and use it for both renders. The fake-tokenizer test returned a bare list and missed this, so add a BatchEncoding-returning fake and assert the mask matches. + +--ISSUE +Content-Type: application/issue +ID: 16 +Type: bugfix +Title: generation operators pass BatchEncoding to generate (transformers 5.x) +Status: open +Priority: high +Created: 2026-06-18 +Module: sekft +Relationships: +Description: The same transformers 5.x return-type change that broke + build_masked_example (#15) also breaks the generation path: + apply_chat_template(add_generation_prompt=True, + return_tensors='pt') returns a BatchEncoding, and eval.py and + resident.py pass it straight to model.generate(), which does + inputs_tensor.shape[0] -> AttributeError (the holdout eval crashed + here on scenario 1). #15 only fixed the trainer. Factor the id + extraction into a shared _input_ids helper, add + render_prompt_ids(tokenizer, messages, device) in sft.py, and use + it in both operators. Add a unit test for _input_ids covering the + BatchEncoding and bare-sequence cases. This is the sweep I should + have done at #15.