-
Notifications
You must be signed in to change notification settings - Fork 448
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 eos_token problem in all required models #1806
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/1806
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 33c6d54 with merge base c5b7386 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Actually, I think that tests with this big lists of token ids should be refactored(maybe some fixture?). |
@RdoubleA @joecummings Require review |
torchtune/models/phi3/_tokenizer.py
Outdated
@@ -101,13 +101,11 @@ def encode( | |||
trim_leading_whitespace=trim_leading_whitespace, | |||
) | |||
|
|||
def decode(self, ids: List[int], skip_special_tokens: bool = True) -> str: |
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.
Why did you remove skip_special_tokens
?
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.
Weird, maybe accidentally removed. Let me fix
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.
Fixed
Will think about it more and maybe open PR |
Something really weird. |
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
Context
What is the purpose of this PR? Is it to
Please link to any issues this PR addresses.
Changelog
What are the changes made in this PR?
Closes #1478
Closes #1479
Closes #1480
Closes #1481
Test plan
Please make sure to do each of the following if applicable to your PR. If you're unsure about any one of these just ask and we will happily help. We also have a contributing page for some guidance on contributing.
pre-commit install
)pytest tests
pytest tests -m integration_test
UX
If your function changed a public API, please add a dummy example of what the user experience will look like when calling it.
Here is a docstring example
and a tutorial example
So generally for Mistral and Gemma - just check to pass None if add_eos = False in
tokenize_messages_no_special_tokens
For Qwen and Phi - same check as in #1477 in truncate(actually for Phi should be reviewed in more accurate way)
And 4 unittests for all models.