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

Remove one of the duplicate bos tokens #2708

Merged
merged 2 commits into from
Nov 12, 2024
Merged

Conversation

AllentDan
Copy link
Collaborator

No description provided.

f'Detected duplicate leading {self.bos_token_id} in prompt, '
'this will likely reduce response quality, one of them will be'
'removed')
encoded = encoded[1:]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Shall we do this or just throw a warning?

encoded = self.model.encode(s, add_bos, add_special_tokens, **kwargs)
if encoded[:2] == [self.bos_token_id] * 2:
get_logger('lmdeploy').warn(
f'Detected duplicate leading {self.bos_token_id} in prompt, '
Copy link
Collaborator

Choose a reason for hiding this comment

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

leading -> bos token

@lvhan028 lvhan028 merged commit 67a8538 into InternLM:main Nov 12, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants