Key Error 'loss' while fine tuning GPT-2 with the Trainer utility

sebansunny
Fri, 18 Dec 2020 03:58:46 +0000

I ignored adding the function and this line -https://github.com/huggingface/transformers/blob/bf713cdec7c27416f514f231ba6728cfc8135120/examples/language-modeling/run_clm.py#L310. I skipped it because i was using a very small dataset. It works now! Thank you so much for your help!