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

max_len check gives poor warning message #40

Open
prhbrt opened this issue Apr 7, 2022 · 0 comments
Open

max_len check gives poor warning message #40

prhbrt opened this issue Apr 7, 2022 · 0 comments

Comments

@prhbrt
Copy link

prhbrt commented Apr 7, 2022

Change this:

msg = f'Sentence #{item} length {len(tokens)} exceeds max_len {self.max_len} and has been truncated'

to

msg = f'Sentence #{item} length {len(tokens)} exceeds max_len {self.max_len} - 2 and has been truncated, note that two tokens are used to surround the sentence with the [CLS] and [SEP] token'

Since the warning Sentence 4 length 511 exceeds max_len 512 and has been truncated doesn't make sense.

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

No branches or pull requests

1 participant