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

text length warning #25

Closed
cwoonb opened this issue Jan 29, 2024 · 2 comments
Closed

text length warning #25

cwoonb opened this issue Jan 29, 2024 · 2 comments

Comments

@cwoonb
Copy link

cwoonb commented Jan 29, 2024

Token indices sequence length is longer than the specified maximum sequence length for this model (2268 > 512). Running this sequence through the model will result in indexing errors
Can I ignore the warning notice above? Why is it popping up?

@cwoonb
Copy link
Author

cwoonb commented Jan 29, 2024

ah! and
torch.save(model.state_dict(), "outputs/")
I don't need to use code, but can you tell me how to save and load the model?
I searched on Google and it said I had to inherit from torch.nn, but that didn't work.

@mwachnicki
Copy link
Collaborator

mwachnicki commented Jan 30, 2024

Just as in our example - the warning is expected and should be just ignored.
https://github.com/mim-solutions/bert_for_longer_texts/blob/main/notebooks/example_model_with_pooling_fit_predict.ipynb

Model's class has its own load and save methods implemented. Look at the example below.
https://github.com/mim-solutions/bert_for_longer_texts/blob/main/tests/test_bert_with_pooling.py#L59

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