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

add 'right' option for 'truncation_strategy' #2754

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zsxm1998
Copy link

@zsxm1998 zsxm1998 commented Dec 24, 2024

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

A new 'right' parameter has been added to the truncation_strategy, corresponding to right-side truncation. This is necessary, especially in the training of multimodal large models. For instance, if an image is input at the beginning of the data but the model's output exceeds the max_length, left-side truncation alone may result in the image being cut off, causing the model to lose crucial context for generating the result.

Experiment results

No experiment.

@Jintao-Huang
Copy link
Collaborator

hello, thanks for your PR.

The delete strategy seems to be able to handle this situation. If a right trim results in an entirely clean response, I believe it will throw an error.

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