Dont use sigmoid when num_labels==1
It seems like we use MSELoss when num_labels==1 in config, i.e. a single column regression problem. But in text_classification pipeline, this is considered as a classification problem and uses sigmoid. This PR fixes that issue. 
Sorry, I don't really understand this - could give a bit more context?<|||||>@patrickvonplaten Please see this https://github.com/huggingface/transformers/blob/master/src/transformers/models/bert/modeling_bert.py#L1515
or any `XForSequenceClassification` model<|||||>This is a very big breaking change. What do you think of the proposed approach here? https://github.com/huggingface/transformers/pull/8328
I think it allows what you're looking for, but in backwards-compatible way.

The PR is old and the diff isn't very readable, but if that's something that could fit your use case I can update it to the latest code.<|||||>@LysandreJik The way it's done in the pipeline here is absolutely incorrect. If the model is trained using MSELoss when num_labels = 1, it means that it is a regression problem and in that case, we should return raw values, not sigmoid. 
Returning raw values can be an option but for now, this fix is important as the values returned for num_labels=1 in this pipeline is incorrect: it should return raw value for regression, not sigmoid.<|||||>@LysandreJik Also, I didn't understand what would this PR break? <|||||>Thank you for your feedback. It was done this way in order to enable inference on [DialogRPT](https://github.com/golsun/DialogRPT). It was the first model that performed sequence classification with a single label, so we defined it this way as you can see in this issue https://github.com/huggingface/transformers/issues/7493.

I understand that this is an issue for most cases, so being able to return raw values is important. However, we must find a way to do it in a backwards compatible way. We can't just change the code and break all models that rely on that pipeline.

> @LysandreJik Also, I didn't understand what would this PR break?

Well, for one, all of the DialogRPT models on the [hub](https://huggingface.co/models?search=dialogrpt).<|||||>I have updated PR #8328 for better readability. If this suits your use-case, I'll try to have it merged ASAP so as not to be blocking for you.<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.