-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for num_return_sequences to BLIP_Decoder.generate ? #64
Comments
Thanks for the suggestion. It is definitely possible to generate multiple sentences. We do not plan to change the code now in case it break other codes, but feel free to clone the code and change num_return_sequences for yourself. |
Thank you! It seems this only works for nucleus sampling method – is that right? Thanks again. :) |
You can also return multiple sentences with beam search, please refer to the generate function description here: https://huggingface.co/docs/transformers/main/en/main_classes/text_generation |
Congrats on creating such an effective image captioner! I'm using it in a project, and noticing that it's popping up in quite a few other places as well.
Inspired in part by this paper – https://arxiv.org/pdf/2205.10747.pdf – I was wondering if it would be possible to generate multiple candidate captions instead of just one?
It looks like it is possible, at least using the nucleus sampling method, but the value of num_return_sequences is hard-coded = 1 in the Blip_Decoder generate method – see here: https://github.com/salesforce/BLIP/blob/main/models/blip.py#L149
Would it be possible to add num_return_sequences to the generate method arguments and thus get multiple candidate captions?
Thank you!
The text was updated successfully, but these errors were encountered: