Migrated pre-hub models' tokenizers don't configure the same as their pre-hub version
Author: mlamera
Pull request: no

### System Info

transformers version: 4.38.0.dev0
python version: 3.10.12

### Who can help?

@younesbelkada 


### 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

**Example Snippet**
```
from transformers import AutoTokenizer
tokenizer1 = AutoTokenizer.from_pretrained("gpt2")
tokenizer2 = AutoTokenizer.from_pretrained("openai-community/gpt2")
print(tokenizer1.model_max_length, tokenizer2.model_max_length)
```
**Output**
`1024 1000000000000000019884624838656`


### Expected behavior

Somewhat related to this issue https://github.com/huggingface/transformers/issues/14561 ,

I feel like the tokenizers for the migrated models should mimic the same behavior as the pre-"Hub" checkpoints since they are referring to the same model and the pre-Hub checkpoints don't show up in the model cards anymore. Some other models that got migrated and face issues would be
t5-base -> google-t5/t5-base 
distilbert-base-uncased -> distilbert/distilbert-base-uncased
bert-base-uncased -> google-bert/bert-base-uncased

The easy, yet long way, would be to add the additional pathing to each models tokenization.py file.


Comments:
Hey @mlamera! I believe this is due to the `transformers` library overriding some attributes of the config due to the explicit definition here:

https://github.com/huggingface/transformers/blob/f497f564bb76697edab09184a252fc1b1a326d1e/src/transformers/models/gpt2/tokenization_gpt2.py#L53-L60

This should have been fixed by https://github.com/huggingface/transformers/pull/29001, if you install from `main` you shouldn't get this issue anymore:

Running your code example before that commit:
```py
In [1]: from transformers import AutoTokenizer
   ...: tokenizer1 = AutoTokenizer.from_pretrained("gpt2")
   ...: tokenizer2 = AutoTokenizer.from_pretrained("openai-community/gpt2")
   ...: print(tokenizer1.model_max_length, tokenizer2.model_max_length)
1024 1000000000000000019884624838656
```

Running your code example after that commit:
```py
In [1]: from transformers import AutoTokenizer
   ...: tokenizer1 = AutoTokenizer.from_pretrained("gpt2")
   ...: tokenizer2 = AutoTokenizer.from_pretrained("openai-community/gpt2")
   ...: print(tokenizer1.model_max_length, tokenizer2.model_max_length)
1000000000000000019884624838656 1024
```

The better solution, however, would be to update the configuration files on the Hub themselves so that they work without the explicit override. I'll take care of that and link the updates here!

Thanks for reporting :hugs: 

I'm opening PRs on the affected repositories such as:
https://huggingface.co/albert/albert-large-v1/discussions/2
https://huggingface.co/albert/albert-base-v2/discussions/6
https://huggingface.co/albert/albert-large-v1/discussions/2
https://huggingface.co/albert/albert-large-v2/discussions/3
https://huggingface.co/albert/albert-xlarge-v1/discussions/2
https://huggingface.co/albert/albert-xlarge-v2/discussions/2
https://huggingface.co/albert/albert-xxlarge-v1/discussions/3
https://huggingface.co/albert/albert-xxlarge-v2/discussions/3


I opened a PR for `openai-community/gpt2` here: https://huggingface.co/openai-community/gpt2/discussions/80

Can you please confirm whether it fixes the issue you're encountering? If so, I'll open Prs to the rest of the affected models. A simple way to test it would be to do:

```py
from transformers import AutoTokenizer

tokenizer1 = AutoTokenizer.from_pretrained("gpt2", revision='refs/pr/80')
tokenizer2 = AutoTokenizer.from_pretrained("openai-community/gpt2")

print(tokenizer1.model_max_length, tokenizer2.model_max_length)
```

> I opened a PR for `openai-community/gpt2` here: https://huggingface.co/openai-community/gpt2/discussions/80
> 
> Can you please confirm whether it fixes the issue you're encountering? If so, I'll open Prs to the rest of the affected models. A simple way to test it would be to do:
> 
> ```python
> from transformers import AutoTokenizer
> 
> tokenizer1 = AutoTokenizer.from_pretrained("gpt2", revision='refs/pr/80')
> tokenizer2 = AutoTokenizer.from_pretrained("openai-community/gpt2")
> 
> print(tokenizer1.model_max_length, tokenizer2.model_max_length)
> ```

The fix looks good thank you!


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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.