KeyError: eval_loss when using Trainer (SpeechT5 fine-tuning)
Author: hollance
Pull request: no
Labels: name: bug

### System Info

current main branch of Transformers (4.29.0.dev0, 20 Apr 2023)


### Who can help?

@hollance

### Information

- [X] 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

We recently published a Colab notebook for fine-tuning SpeechT5 for TTS. https://colab.research.google.com/drive/1i7I5pzBcU3WDFarDnzweIj4-sVVoIUFJ

This notebook worked fine previously but now it gives an error in `trainer.py` because the `eval_loss` is not part of the metrics. This happens when saving the checkpoint. The progress bar in the notebook shows "No log" for the Validation Loss.

I will look into this issue myself first and try to get a smaller reproducible case. My hunch is that something changed in Trainer in between the time I wrote the notebook and now (for example, it now requires Accelerate).

### Expected behavior

The notebook should work as before.

Comments:
Added a Colab that demonstrates the issue with a minimal amount of code: https://colab.research.google.com/drive/12AFpcCE96C22-IxRRJjDIo1s4wDsP0v_?usp=sharing

I still had a copy of the SpeechT5 TTS fine-tuning changes on 4.28.dev and that works fine, so something that changed between 4.28 and 4.29 has broken this. Still investigating.

OK the issue seems to be that `stop_labels` is not present in the input (since we're not actually using them) and as a result, the evaluation loop thinks the model doesn't have labels (even though it does) and doesn't report the loss. 

I had initially removed `stop_labels` from `model.forward` when implementing the TTS fine-tuning logic, but had put it back at the last minute to keep backwards compatibility with the publicly released version of SpeechT5. That's why the fine-tuning Colab used to work but is now broken.

The question now is: why does the Trainer believe `stop_labels` are labels? And how can I tell it to ignore them?


The workaround is to add the following when creating the training arguments:

```python
training_args = Seq2SeqTrainingArguments(
    ...
    label_names=["labels"],
)
```

The Trainer looks at the signature of `model.forward()` and anything with `labels` in it is assumed to be labels, which in this case includes `stop_labels`. We'll remove this argument in a future version of Transformers. But until then you can override this by supplying your own `label_names` that does not include `stop_labels`.

Ran into a similar error 

> The workaround is to add the following when creating the training arguments:
> 
> ```python
> training_args = Seq2SeqTrainingArguments(
>     ...
>     label_names=["labels"],
> )
> ```
> 
> The Trainer looks at the signature of `model.forward()` and anything with `labels` in it is assumed to be labels, which in this case includes `stop_labels`. We'll remove this argument in a future version of Transformers. But until then you can override this by supplying your own `label_names` that does not include `stop_labels`.

Ran into a very similar issue when fine-tuning BLIP2 and turns out this was the only line i was missing