BLIP-2 request:  If it's even possible, can you please provide an official example script of how to get the text(caption) features and image features into the same vector space (e.g. for cross-modal retrieval/search using BLIP-2 models, similar to what we can already do with CLIP.)  Thanks in advance.
### System Info

linux, python 3.8+, pytorch '1.13.0+cu116'

### Who can help?

@sgugger

### Information

- [X] 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

N/A

### Expected behavior

N/A
Hi @wingz1, thanks for raising an issue! 

This is a question best placed in our [forums](https://discuss.huggingface.co/). We try to reserve the github issues for feature requests and bug reports.

There are code examples of how to use [BLIP](https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/blip#transformers.BlipModel.forward.example) and [BLIP-2](https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/blip-2#transformers.Blip2Model) in the docs. Both have a similar API to CLIP and have the same methods e.g. `get_text_features`, `get_image_features` implemented and return similar outputs. <|||||>Thanks, I figured that -- I will check the forums!   Indeed those methods do exist in BLIP-2, but those outputs don't share the same dimensionality or mean the same thing as the equivalent commands in CLIP due to the how the model is set up.<|||||>Not really a useful answer, but from the following lines in the modeling file, you can go `language_projection` to get the same dimension. But it's super questionable regarding if this is `the same space` with the meaningful text/image features.

(and yes, further question on this topic should be on the forum)

> self.language_projection = nn.Linear(config.qformer_config.hidden_size, config.text_config.hidden_size)

> ilanguage_model_inputs = self.language_projection(query_output)

>  inputs_embeds = self.language_model.get_input_embeddings()(input_ids)
>  inputs_embeds = torch.cat([language_model_inputs, inputs_embeds], dim=1)<|||||>Hi I think multimodal embeddings is something lacking in the current implementation, where we can't extract embeddings obtained by passing both text and image to the QFormer, infact the Qformer in HF doesn't even take text `input_ids` as input [here](https://github.com/huggingface/transformers/blob/66c240f3c950612fa05b2e14c85d4b86c88e473e/src/transformers/models/blip_2/modeling_blip_2.py#L1081 ) 

Whereas the original Qformer implementation did take text inputs as input_id [here](https://github.com/salesforce/LAVIS/blob/91c8e6863b4b02d7d75167e7d18037ef3a96c54b/lavis/models/blip2_models/Qformer.py#L804) , along with the image and this can be used to extract multimodal embeddings as done in the `extract_features` fn [here](https://github.com/salesforce/LAVIS/blob/f982acc73288408bceda2d35471a8fcf55aa04ca/lavis/models/blip2_models/blip2_qformer.py#L387)