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

Merged
merged 1 commit into from
Jan 1, 2025

Conversation

zsxm1998
Copy link
Contributor

@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.

@zsxm1998
Copy link
Contributor Author

Thank you for your thoughtful response.

However, I would like to clarify that the delete strategy directly removes overly long samples, which may lead to wasted samples. Additionally, I apologize for any confusion, but I did not fully understand your last sentence. Would you be so kind as to provide a more detailed explanation? I greatly appreciate your insights and look forward to further discussion.

@Jintao-Huang
Copy link
Collaborator

I understand. thanks

@Jintao-Huang Jintao-Huang merged commit 980119a into modelscope:main Jan 1, 2025
1 of 2 checks passed
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