Having inconsistent results when I import pipeline of my custom made sequence classification
Below is my SequenceClassificationClass‘’’class RobertaForSequenceClassification(RobertaPreTrainedModel):definit(self, config):super().init(config)self.num_labels = config.num_labelsself.roberta = RobertaModel(config, add_pooling_layer=False)  # initialize roberta with no pooling layerself.dropout = nn.Dropout(config.hidden_dropout_prob)self.linear = nn.Linear(config.hidden_size, config.num_labels)self.post_init()def forward(self, input_ids = None, attention_mask = None, token_type_ids=None, labels = None, **kwargs):outputs = self.roberta(input_ids=input_ids, attention_mask = attention_mask,token_type_ids = token_type_ids, **kwargs)sequence_outputs = self.dropout(outputs[0][:, 0, :])logits = self.linear(sequence_outputs)loss = Noneif labels is not None:loss_fct = nn.CrossEntropyLoss()loss = loss_fct(logits, labels)return SequenceClassifierOutput(loss = loss, logits = logits, 
                                hidden_states=outputs.hidden_states,
                                attentions=outputs.attentions)‘’’pipeline resultsres1485×512 47.1 KBWhen I switched to AutoModelForSequenceClassification, the pipeline gave me the right results so I guess the problem is from my custom head but I cant seem to debug it. I also got correct results using my custom head without a pipeline