aitextgen
aitextgen copied to clipboard
Any way to stop GPT-2 from generating specific characters?
I've played with simple-gpt2 as well as aitextgen, and I was wondering if there was a recommended way to prevent certain characters from being generated. Ideally I'd be able to specify characters in unicode and then obviously those characters would be converted to their bpe equivalents in the code before they're prevented from being generated. Is there any way to do that already? Is there a recommended way to proceed in that direction? Thanks!
There is a bad_words_id
param that might work: https://huggingface.co/transformers/main_classes/model.html?highlight=generate#transformers.generation_utils.GenerationMixin.generate