T5ForConditionalGeneration for text generation

Hi Guys,

I am new for Hugging face transformer. I am working on an project where in I want to do adversarial attack like PGD for text summarization, where in when I Give the adversarial input the out put should be constant “I am a good summarizer”. For this I need to access the input embeddings, which I can access using get_input_embeddings() perturb this embedding and give it to the model.

I needed help with how to feed this perturb embedding to the model and how to alter the loss function so that I can generate a constant text “I am a good summarizer”.

Please help me with this and let me know if any more information is required.