I trained a language model (encoder-decoder) to generate text. I want to restrict the generation vocab of this model to a specific vocab. How can I do that?
I found in generate
(model.generate) function that I can pass a parameter called force_words_ids
where the model will be forced to generate "all" the tokens in this list. I am looking for something similar, but instead, to generate some of the list's tokens.