Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix _process_tokens for empty prompts in KTOTrainer (#2093)
The function _process_tokens in trl/trainers/kto_trainer.py crashes if the prompt_input_ids are an empty list. - added a check for nonzero length - added a check for nonzero length of answer_input_ids for consistency The checks happen when determining when subtracting 1 from max_length (happens when BOS or EOS is already present).
- Loading branch information