Not able to use DistilBERT in VisualTextDualEncoder
Author: jagjeetsian
Pull request: no
Labels: name: bug

### System Info

- `transformers` version: 4.20.1
- Platform: Linux-5.10.133+-x86_64-with-debian-bullseye-sid
- Python version: 3.7.12
- Huggingface_hub version: 0.8.1
- PyTorch version (GPU?): 1.11.0 (True)
- Tensorflow version (GPU?): 2.6.4 (True)
- Flax version (CPU?/GPU?/TPU?): 0.5.2 (gpu)
- Jax version: 0.3.14
- JaxLib version: 0.3.14
- Using GPU in script?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>


### Who can help?

@NielsRogge

### 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 PIL import Image
import requests
from transformers import (
    VisionTextDualEncoderModel,
    VisionTextDualEncoderProcessor,
    AutoFeatureExtractor,
    AutoTokenizer,
    
)
tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")
feature_extractor = AutoFeatureExtractor.from_pretrained("google/vit-base-patch16-224")
processor = VisionTextDualEncoderProcessor(feature_extractor, tokenizer)
model = VisionTextDualEncoderModel.from_vision_text_pretrained(
    "google/vit-base-patch16-224", "distilbert-base-uncased"
)

# contrastive training
urls = [
    "http://images.cocodataset.org/val2017/000000039769.jpg",
    "https://farm3.staticflickr.com/2674/5850229113_4fe05d5265_z.jpg",
]
images = [Image.open(requests.get(url, stream=True).raw) for url in urls]
inputs = processor(
    text=["a photo of a cat", "a photo of a dog"], images=images, return_tensors="pt", padding=True
)
outputs = model(
    input_ids=inputs.input_ids,
    attention_mask=inputs.attention_mask,
    pixel_values=inputs.pixel_values,
    return_loss=True,
)
loss, logits_per_image = outputs.loss, outputs.logits_per_image  # this is the image-text similarity score

# save and load from pretrained
model.save_pretrained("vit-bert")
model = VisionTextDualEncoderModel.from_pretrained("vit-bert")

# inference
outputs = model(**inputs)
logits_per_image = outputs.logits_per_image  # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1)  # we can take the softmax to get the label probabilities
```
TypeError: forward() got an unexpected keyword argument 'token_type_ids'

### Expected behavior

`CLIPOutput' object with these components:
['loss',
 'logits_per_image',
 'logits_per_text',
 'text_embeds',
 'image_embeds',
 'text_model_output',
 'vision_model_output']

Comments:
I believe this is because [this line in `modeling_vision_text_dual_encoder.py`](https://github.com/huggingface/transformers/blob/14928921e2f6d5b049d8dcfa07982e9ca351a402/src/transformers/models/vision_text_dual_encoder/modeling_vision_text_dual_encoder.py#L368) passes a keyword argument `token_type_ids` to the `text_model` which is not supported by the `distilbert-base-uncased` model.

Hi,

The scripts are meant as examples, and you can easily tweak them for your use case. So it's advised to fork the library and tweak it to your liking.

If you can come up with a fix that makes the scrpit more general, feel free to open a PR.

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.