Implement QFormer for pretrain
### Feature request

In [BLIP-2](https://arxiv.org/pdf/2301.12597.pdf), there is a pretraining stage (or stage 1) of QFormer.
![image](https://user-images.githubusercontent.com/38489776/230536840-5b466474-0e29-4029-976b-68c966b2b499.png)

Implementation of QFormer in this stage is requested.

### Motivation

In [HuggingFace's source code of BLIP-2](https://github.com/huggingface/transformers/blob/v4.27.2/src/transformers/models/blip_2/modeling_blip_2.py#L1019), I see no implementations for text inputs, Image-text contrastive loss, Image-grounded text generation loss, Image-text matching loss for pretraining. Currently, The source code only provides for vision-language generative learning (stage 2). Therefore, it will be very helpful for people who are interested in stage 1 of QFormer (like me).

### Your contribution

Unfortunately, I don't think there is a way that I could help.
@NielsRogge Gentle ping because I saw your name in the docs<|||||>cc @younesbelkada <|||||>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.<|||||>as the issue is reopened, is there any plan to impl the loss for qformer?<|||||>Hi @jianantian , I didn't had time to have a look unfortunately, if you want to try your hands on it, feel free to open a PR and we'll guide you frm there!<|||||>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.