"num_captions" parameter for BLIP2. (model.generate)

#11
by Zilun - opened

Hi, thanks for the contribution.

In the LAVIS repo, we can pass in the parameter "num_captions" when we generate multiple captions for a given image (https://github.com/salesforce/LAVIS/blob/main/examples/blip2_instructed_generation.ipynb).

However, the hugging face implementation does not allow us to pass in this parameter. Is there a way to pass this parameter?

It seems that the hugging face version considered this parameter (https://github.com/huggingface/transformers/blob/main/src/transformers/models/blip_2/modeling_blip_2.py#:~:text=captions%20(list)%3A%20A%20list%20of%20strings%20of%20length%20batch_size%20*%20num_captions.).

Zilun changed discussion title from "num_captions parameter for BLIP2. (model.generate) to "num_captions" parameter for BLIP2. (model.generate)
Zilun changed discussion status to closed
Zilun changed discussion status to open

Sign up or log in to comment