I have added to the GPT-2 vocabulary two special tokens (
[se]) and use it to generate sequences.
I want to prohibit GPT-2 from generating some words after having generated
[ss] until it generates
[se] . For example in the following sequence
some words of the sequence [ss] here I want some words not to be generated [se] other words of the sequence.
in other words, I want between
[se] to exclude some words from the generation. As @deathcrush answered here it is possible to prohibit GPT-2 from generating some vocabulary ids in general, but is it possible to do it on condition? (only between those tokens