The EncoderDecoderModel
class is not meant to do token classification. It is meant to do text generation (like summarization, translation). Hence, the head on top of the decoder will be a language modeling head.
To do token classification, you can use any xxxForTokenClassification
model in the library, such as BertForTokenClassification
or RobertaForTokenClassification
.