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

Fix token counting to allow there to be no attention mask #818

Merged
merged 3 commits into from
Dec 22, 2023

Conversation

dakinggg
Copy link
Collaborator

@dakinggg dakinggg commented Dec 21, 2023

When we pretokenize, we just pass raw tensors to the collator, which does not add an attention mask. This is fine, because we pretokenize without padding, but would crash on the token counting function if your tokenizer had a pad token.

IFT token count same before and after
Screenshot 2023-12-21 at 4 11 02 PM

pretokenized token count as expected (40x2048x960)
Screenshot 2023-12-21 at 4 11 13 PM

@dakinggg dakinggg marked this pull request as ready for review December 22, 2023 00:01
Copy link
Contributor

@alextrott16 alextrott16 left a comment

Choose a reason for hiding this comment

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

"I knew you'd come crawling back"
-- input_ids, probably

@dakinggg dakinggg merged commit 836ab95 into mosaicml:main Dec 22, 2023
10 checks passed
@dakinggg dakinggg deleted the fix-no-attn-mask branch February 10, 2024 07:30
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.

None yet

3 participants