Inside you do
outputs = self.bert(
input_ids,
attention_mask=attention_mask,
token_type_ids=token_type_ids,
labels=labels
)
but the bert
attribute of this model is a BertModel
which does not expect labels
.