KeyError: 'loss' while trying to finetune Bart model on custom dataset for summarization.
I am trying to finetune BART on my custom dataset by following a huggingface finetuning tutorial. 


<img width="796" alt="Screen Shot 2022-04-05 at 10 29 54 AM" src="https://user-images.githubusercontent.com/78582210/161777173-50af5514-443e-429e-9a99-468c50fe4e03.png">
<img width="846" alt="Screen Shot 2022-04-05 at 10 33 33 AM" src="https://user-images.githubusercontent.com/78582210/161777920-67c25cf2-afe6-435a-8b46-d3d1e639d394.png">
<img width="485" alt="Screen Shot 2022-04-05 at 10 34 05 AM" src="https://user-images.githubusercontent.com/78582210/161778025-2eeafd95-e21d-4385-b265-1c33cdf15d0a.png">
<img width="731" alt="Screen Shot 2022-04-05 at 10 34 24 AM" src="https://user-images.githubusercontent.com/78582210/161778096-c5ab1a96-8bdc-4337-b320-54812993ee0d.png">
At which point I am met with the keyError: 'loss' error. I looked at https://discuss.huggingface.co/t/keyerror-loss-during-fine-tuning-bert-base-italian-cased-for-qa/6638/2 but wasn't able to figure it out for my code. Please help!


@sgugger 
Please use the forums to debug your code. You are using the base model class here, that does not accept `labels` and does not return a loss. You should use a model that can be fine-tuned on your task.<|||||>@sgugger Apologies for that and thank you for letting me know. All articles for BART finetuning I came across use the `pretrained_model_name = "facebook/bart-large-cnn"` model. Is there a small version like "t5-small" ? <|||||>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.