Good word list in generate function
Hi,I know it’s possible to passbad_words_idsto thegeneratefunction. I was wondering what is the best way to do the opposite. Giving the model a word list and force it to only use them.Thanks
2023-03-23T17:10:54Z
Setting the logits to +Inf for certain token, i.e. opposite to what is done in withbad_words_idswould result in a sequence that only contains that token(s) and, probably, make no sense as a sentence. Something likethisfeature request I submitted would allow a bit more flexibility. Feel free to react/comment to it. Also checkthisfrom the docs.