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

CodeT5 tokenizer.model_max_length is 1000000000000000019884624838656 #16842

Closed
4 tasks
khoda81 opened this issue Apr 19, 2022 · 2 comments
Closed
4 tasks

CodeT5 tokenizer.model_max_length is 1000000000000000019884624838656 #16842

khoda81 opened this issue Apr 19, 2022 · 2 comments
Labels

Comments

@khoda81
Copy link

khoda81 commented Apr 19, 2022

System Info

- `transformers` version: 4.12.2
- Platform: Windows-10-10.0.22000-SP0
- Python version: 3.9.7
- PyTorch version (GPU?): 1.10.2 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: False
- Using distributed or parallel set-up in script?: False

Who can help?

@patrickvonplaten

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("formermagic/codet5-large")
print(tokenizer.model_max_length)

This prints 1000000000000000019884624838656.

Expected behavior

To print 512.
@khoda81 khoda81 added the bug label Apr 19, 2022
@patrickvonplaten
Copy link
Contributor

Hey @khoda81,

The bug seems to be related directly to the model of @mozharovsky and not really to a canonical model. However, also not that T5 does not have a maximum length. You can use T5 with lengths as long as you want until your memory errors out. T5 uses relative positional embeddings so that there is no static weight that will give you an "out-of-index" error.

Also see: #5204

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@khoda81 khoda81 closed this as completed May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants