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

Confusion about the max_positions value #62

Closed
Cheerful0 opened this issue Apr 11, 2024 · 1 comment
Closed

Confusion about the max_positions value #62

Cheerful0 opened this issue Apr 11, 2024 · 1 comment

Comments

@Cheerful0
Copy link

Hello,
In the module of get_pretrained_model, you set the 'max_positions=32', I cannot understand the meaning of this value equal to 32, could you please tell me why set the value in it?
Thanks

@dallatt
Copy link
Contributor

dallatt commented May 14, 2024

Hello @Cheerful0,

The max_positions is here to deal with padding and as a protection. The tokenizer returned by get_pretrained_model will pad the sequences to this max_positions and raise an error if a sequence longer than this is passed to it. That way, you are sure to provide the model with sequences of appropriate length and you don't have to deal yourself with batching the inputs!

Hope this helps,
Hugo

@dallatt dallatt closed this as completed May 14, 2024
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

2 participants