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

Correctly identify special tokens during generation #438

Merged
merged 3 commits into from
Jan 24, 2024

Conversation

dacorvo
Copy link
Collaborator

@dacorvo dacorvo commented Jan 24, 2024

The special tokens were never identified as such. This fixes #437.

@dacorvo dacorvo merged commit 1303aa4 into main Jan 24, 2024
@dacorvo dacorvo deleted the fix_tgi_special_token branch January 24, 2024 10:22
@@ -291,7 +291,7 @@ def __init__(
tokenizer.pad_token_id = tokenizer.eos_token_id
tokenizer.padding_side = "left"
self.tokenizer = tokenizer
self.special_tokens = [self.tokenizer.eos_token_id, self.tokenizer.pad_token_id]
self.special_tokens = self.tokenizer.all_special_ids
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to use a set() here to use optimized lookup?

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.

TGI for Inf2 does not special=True in the last token of a stream
4 participants