Does has a "no_repeat_ngram_size" attribute?

Good day,

I’m generating text with I would like to know if there is any way to pass the attribute no_repeat_ngram_size. I have seen that attribute with model. generate but not in

hi @kintaro, is used for auto-regressive generation which uses sampling.
no_repeat_ngram_size is used for beam search so doesn’t have that attribute since it only uses sampling for generation

Hi @kintaro and @valhalla

Thanks @valhalla for replying right away! In this case, no_repeat_ngram_size can actually be applied both in the beam search and sampling generation. I think we just left the option out of the script because we didn’t want it to be too crowded, but you can just pass the argument in:

(just add a e.g. no_repeat_ngram_size=3, line in the arguments for the generate function)

1 Like

Thanks @yjernite! Didn’t know that no_repeat_ngram_size can also be used with sampling.

Thanks a lot for your great help