TFSequenceClassifierOutput can't return loss batch_size when num_labels=1
### System Info

[**Colab Env**](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification-tf.ipynb)
- `transformers` version: 4.22.2
- Platform: Linux-5.10.133+-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.7.14
- Huggingface_hub version: 0.10.0
- PyTorch version (GPU?): 1.12.1+cu113 (False)
- Tensorflow version (GPU?): 2.8.2 (False)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: <fill in>
- Using distributed or parallel set-up in script?: No

### Who can help?

@Rocketknight1 @sgugger @stevhliu

### Information

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

### Tasks

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

### Reproduction

https://colab.research.google.com/drive/1lTxUPTa0XPRXJRV1NDYzwvzcMOY-fqJf?usp=sharing

### Expected behavior

`STS-B` task can train with `model.fit()`
Verified the issue, making a patch now!<|||||>@goreng2 I've submitted a fix at #19316. I'll let you know when this is merged to main.<|||||>@goreng2 The fix should now be merged, but you'll have to install from `main` to use it until the next official release. To do that, replace `pip install transformers` with `pip install --upgrade git+https://github.com/huggingface/transformers.git`. After our next release you can change your code back to just `pip install transformers`.

If this doesn't resolve your problem, feel free to comment and re-open this issue!<|||||>@Rocketknight1 It works! Thanks :) you save me!