-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Combine generate()
functions
#1675
Conversation
I'm calling it a night, but the PR is pretty much done. All that's left is to fix the new The excruciating pain of dealing with |
Co-authored-by: Sebastian Raschka <mail@sebastianraschka.com>
Co-authored-by: Sebastian Raschka <mail@sebastianraschka.com>
af90a4b
to
6bd381a
Compare
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.
Looks like a good restructure at first glance. Just some early comments. There'll be more!
# TODO: Is there a way to not have to do this? | ||
# This may actually affect our tokens per second. | ||
|
||
# sentencepiece does not support decoding token-by-token because it adds spaces based on the surrounding 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.
@Andrei-Aksionov reimplemented the tokenizer pipeline and may have ideas here
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.
Interesting. I think I didn't test the hack fix in decode
method (with a dummy_token_id) for SentencePiece tokenizer.
So maybe now the logic below is not needed.
@apaz-cli Yes, long story about that. I will describe that to you offline |
Co-authored-by: Sebastian Raschka <mail@sebastianraschka.com>
litgpt/api.py
Outdated
) | ||
else: | ||
total_devices = use_devices | ||
num_devices = calculate_number_of_devices(devices) |
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.
Any reason why this was changed? Bad rebase maybe?
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.
Yeah. Not sure when it happened.
Co-authored-by: Sebastian Raschka <mail@sebastianraschka.com>
Co-authored-by: Sebastian Raschka <mail@sebastianraschka.com>
Co-authored-by: Sebastian Raschka <mail@sebastianraschka.com>
Co-authored-by: Sebastian Raschka <mail@sebastianraschka.com>
Co-authored-by: Sebastian Raschka <mail@sebastianraschka.com>
Combining the implementations for
litgpt.chat.base.generate()
andlitgpt.chat.base.generate()
. Both are used everywhere, and have very different assumptions, so keeping both around, wrapping the original.WIP, commented out nonsense, tests broken, wanted to get it out there so you could look over it and see if I'm on the right track.
The HF token is a throwaway made specifically for this purpose because I want to see how CI will react, and if it will OOM or not. Will not be in the final version, but I want to make sure it works with llama3 and I can't seem to replicate the test environment.