Skip to content

[SFT] add warning if dataset's input_ids exceed max_length #3449

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

HERIUN
Copy link
Contributor

@HERIUN HERIUN commented May 15, 2025

What does this PR do?

setting default max_length=1024 may problem while long text dataset.

user have to know dataset's max_length and truncated with max_length.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a GitHub issue? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Who can review?

@kashif @qgallouedec

@HERIUN HERIUN changed the title add warning if dataset's input_ids exceed max_length [SFT] add warning if dataset's input_ids exceed max_length May 19, 2025
@qgallouedec
Copy link
Member

Thanks for the PR! I appreciate the intention behind adding visibility into truncation behavior. However, I'm not sure that raising a warning in this case is the best approach. Truncation can be a normal and intentional part of preprocessing, and emitting a warning during expected behavior can be noisy and misleading, especially in workflows where truncation is desired.

Instead, what might be more useful is a utility function (or method, I'm not exactly sure at this point) that prints or returns length statistics (e.g., quantiles) across the dataset. This would give users a clearer view of the lengths distribution and help them to choose the max length.

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