[Bart] Bart model families’ embedding shape?
Author: com3dian
Pull request: no

### System Info

- `transformers` version: 4.26.1
- Platform: Linux-5.15.0-71-generic-x86_64-with-glibc2.31
- Python version: 3.9.12
- Huggingface_hub version: 0.12.1
- PyTorch version (GPU?): 1.13.0+cu117 (False)
- 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?: No
- Using distributed or parallel set-up in script?: No


### Who can help?

@ArthurZucker @younesbelkada

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

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

### Reproduction

I’m implementing a finetuned Bart model for summarization, therefore I’m making decisions between using the ‘facebook/bart-large’ or the ‘facebook/bart-large-cnn’. But when I look into the layers in both models, I found the shapes of their embedding layers are different, is this a special trick?

Code to repeat
```python
from transformers import BartTokenizer, BartModel, BartForConditionalGeneration
BARTmodel = BartModel.from_pretrained('facebook/bart-large')
CGmodel = BartForConditionalGeneration.from_pretrained('facebook/bart-large-cnn')
BARTmodel.shared
-----------
Embedding(50265, 1024, padding_idx=1)
```
```python
CGmodel.model.shared
-----------
Embedding(50264, 1024, padding_idx=1)
```

### Expected behavior

I expect the embedding layer's dimension are equal.

Comments:
Hi @com3dian, thanks for raising this issue. 

The reason the values are different is because the vocab size in the respective model configurations is different: 
* [50265 for `facebook/bart-large`](https://huggingface.co/facebook/bart-large/blob/cb48c1365bd826bd521f650dc2e0940aee54720c/config.json#L71)
* [50264 for `facebook/bart-large-cnn`](https://huggingface.co/facebook/bart-large-cnn/blob/3d224934c6541b2b9147e023c2f6f6fe49bd27e1/config.json#L67)

I'll let @ArthurZucker and @younesbelkada handle whether this is expected :) 

Thanks @amyeroberts !

I found this interesting difference when I was fine-tuning the Bart model for both summarization and other language generation tasks, which will be combined into a complete pipeline. My intention is to utilize the  [facebook/bart-large-cnn](https://huggingface.co/facebook/bart-large-cnn/) model specifically for summarization and the [facebook/bart-large](https://huggingface.co/facebook/bart-large/) model for the other tasks. It would be helpful to identify the missing token in the embedding layer of the [facebook/bart-large-cnn](https://huggingface.co/facebook/bart-large-cnn/) model to ensure alignment of the embedding sizes.

Hey!
Both tokenizers have the same length, 50265. The last token is `{"id":50264,"special":true,"content":"<mask>","single_word":false,"lstrip":true,"rstrip":false,"normalized":true}`. The missing token is the `mask`.
Since the model was finetuned for text-generation (summarization), I think this is expected.

Tell me if this does not answer your question!

Thanks @ArthurZucker, your reply helps a lot!