Issue in using trainer class for Finetuning GPT-2

While using trainer class to finetune gpt-2 on Hindi dataset. It’s outputting the following error

While using trainer class to finetune gpt-2 on Hindi dataset. It’s outputting the following error

TypeError                                 Traceback (most recent call last)
<ipython-input-44-3435b262f1ae> in <module>()
----> 1 trainer.train()

5 frames
/usr/local/lib/python3.6/dist-packages/transformers/data/datasets/language_modeling.py in __getitem__(self, i)
     99 
    100     def __getitem__(self, i) -> torch.Tensor:
--> 101         return torch.tensor(self.examples[i], dtype=torch.long)
    102 
    103 

TypeError: an integer is required (got type NoneType)

Here is the link: https://colab.research.google.com/drive/1um5UeY9hasmjPNcR1WkBe2uDDFhLUBrX?usp=sharing

@valhalla, Hey can you suggest something about what might be the problem. I am using trainer class on Hindi trained GPT-2. I have also shared the Colab.