Good day,
I’m generating text with run_generation.py
. 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 run_generation.py
.
Good day,
I’m generating text with run_generation.py
. 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 run_generation.py
.
hi @kintaro,
run_generation.py
is used for auto-regressive generation which uses sampling.
no_repeat_ngram_size
is used for beam search so run_generation.py
doesn’t have that attribute since it only uses sampling for generation
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 run_generation.py
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)
Thanks @yjernite! Didn’t know that no_repeat_ngram_size
can also be used with sampling.
Thanks a lot for your great help