-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Customise the separator used for splicing in DataCollatorWithFlattening #33114
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, indeed this makes sense.
can you just update the documentation of this datacolator please!
07c6db0
to
0a6539a
Compare
Updated! Feel free to edit if needed:) @ArthurZucker |
Thanks 🤗 |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
…ng (huggingface#33114) * Customising the separator used for splicing in DataCollatorWithFlattening * update DataCollatorWithFlattening docs --------- Co-authored-by: weifangyuan <i.weifangyuan@yuewen.com>
…ng (huggingface#33114) * Customising the separator used for splicing in DataCollatorWithFlattening * update DataCollatorWithFlattening docs --------- Co-authored-by: weifangyuan <i.weifangyuan@yuewen.com>
…ng (huggingface#33114) * Customising the separator used for splicing in DataCollatorWithFlattening * update DataCollatorWithFlattening docs --------- Co-authored-by: weifangyuan <i.weifangyuan@yuewen.com>
…ng (huggingface#33114) * Customising the separator used for splicing in DataCollatorWithFlattening * update DataCollatorWithFlattening docs --------- Co-authored-by: weifangyuan <i.weifangyuan@yuewen.com>
…ng (huggingface#33114) * Customising the separator used for splicing in DataCollatorWithFlattening * update DataCollatorWithFlattening docs --------- Co-authored-by: weifangyuan <i.weifangyuan@yuewen.com>
What does this PR do?
#31629 added
DataCollatorWithFlattening
, which packs examples in a small batch into a long sequence and uses-100
to splice the samples and returnsposition ids
for attention calculation.Since different models may use different token ids for splicing samples during training, for example, when using the Qwen model for post pre-training, short samples can be packed into long samples to speed up training and memory usage, and separated by
<|endoftext|>
, which token id is151643
. So allowing the user to customise the separator may be a more flexible implementation, allowing the user to use this DataCollator when building the pre-training dataset with different models.Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Models: