Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max Length rework #741

Merged
merged 32 commits into from
Jun 6, 2024
Merged

Max Length rework #741

merged 32 commits into from
Jun 6, 2024

Conversation

psinger
Copy link
Collaborator

@psinger psinger commented Jun 4, 2024

This PR adresses several related points:

  • It removes the settings max_length_prompt and max_length_answer and only keeps max_length. It will always use that setting to truncate the left side of the whole input.
  • It will first truncate all prompts on the left side, and all answers on the right side with max_length.
  • It removes the strict requirement for the system prompt to always be on the left side of the input, even if truncated. It will also be truncated if the whole input exceeds max length.
  • Removes the strict forced requirement for the last label to always be eos token, if setting is set.
  • It is now passing correct position_ids to the forward method of the backbone.

@psinger psinger marked this pull request as ready for review June 5, 2024 12:33
Copy link
Collaborator

@pascal-pfeiffer pascal-pfeiffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @psinger. Great changes!

Some suggestions in the code.
I would also suggest to add a small note in the Readme for recent breaking changes, as depending on the parameters, the new behavior could be different, but should be better in general and resemble the chat_template from transformers.

Copy link
Collaborator

@pascal-pfeiffer pascal-pfeiffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the quick changes, looks good to me!

@psinger psinger merged commit bf7f7f9 into main Jun 6, 2024
4 checks passed
@psinger psinger deleted the psi/maxlength branch June 6, 2024 10:49
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.

2 participants