-
Notifications
You must be signed in to change notification settings - Fork 27
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
Handle char level tokenization #11
Conversation
…ference with char tok
src/generation.py
Outdated
@@ -76,6 +86,7 @@ def generate( | |||
mem_after_tok = torch.cuda.memory_allocated(device=x.device) / 1e9 | |||
print_rank_0(f"Memory after tokenization: {mem_after_tok} GB") | |||
print_rank_0("Starting generation...") | |||
torch.cuda.memory._record_memory_history(enabled=True) |
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.
This shouldn't be on by default
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.
Removed
src/generation.py
Outdated
generation[:, : i + 1], | ||
skip_special_tokens=skip_special_tokens, | ||
) | ||
if isinstance(self.tokenizer, CharLevelTokenizer): |
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.
Maybe could slightly reformat this to have different args depending on the Tokenizer class
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.
Reformatted
Also run black and isort! |
Done 😄 |
Add char level tokenizer, modify generation code to handle batched inference with char tok