RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #2 'target' in call to _thnn_nll_loss_forward
### System Info

Hi,

I got the following issue `RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #2 'target' in call to _thnn_nll_loss_forward` when I was finetuning the stsb by using a finetuned roberta. I use [this code](https://github.com/huggingface/transformers/blob/main/examples/pytorch/text-classification/run_glue_no_trainer.py) to finetune the stsb task.

![image](https://user-images.githubusercontent.com/23516191/192100348-2fba2ff9-db30-44ea-af32-7d24b2d7f364.png)

Does anyone have idea to fix the bug? The label for stsb is float type, so the code is using regression to train the model. 

### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

1. Download the finetuned roberta model from [here](https://drive.google.com/drive/folders/1S03HHFKDDQA9mZfS-jMxtsmaJy6-M3A9?usp=sharing). The finetuned roberta was finetuned on a sentence binary classification task. (The issue may caused by the first stage finetuning which I was using a binary classification task, but the downstream task stsb is a regression task.)
2. Load the finetuned roberta model and use [this code](https://github.com/huggingface/transformers/blob/main/examples/pytorch/text-classification/run_glue_no_trainer.py) to finetune the stsb task and I got the above issue.

### Expected behavior

Please give me any advice to solve the issue. Many Thanks.
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/main/CONTRIBUTING.md) are likely to be ignored.