Skip to content

Conversation

@davmels
Copy link

@davmels davmels commented Dec 8, 2025

…rompts.

on line 495, zip() function has a flag strict=True, and only after that we calculate the num_diff_len, which we can not reach in case the chosen and rejected prompt lengths differ by 1 (as zip raises an exception). Therefore, we should take only the first prompt_len_input_ids common parts of the prompts, and find the length differences between the prompts afterwards.

What does this PR do?

Fixes # issue with handling different length chosen/rejected prompts.

…rompts.

on line 495, zip() function has a flag `strict=True`, and only after that we calculate the num_diff_len, which we can not reach in case the chosen and rejected prompt lengths differ by 1 (as zip raises an exception). Therefore, we should take only the first `prompt_len_input_ids` common parts of the prompts, and find length differences afterwards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant