How to train GPT2 transformer on text data


My use case is, I have some text which I want to train GPT 2 transformer on. After training, it should be able to answer my questions related to the text I trained it on. So, it would really be great if someone could let me know how to do that.