# How to train GPT2 transformer on text data

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-train-gpt2-transformer-on-text-data%2F72325%3E%5C
**Category:** Beginners\
**Created:** [February 7, 2024, 9:53pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-train-gpt2-transformer-on-text-data%2F72325 "2024-02-07T21:53:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tushark2111](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@tushark2111](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ftushark2111)%5C
**Post date:** [February 7, 2024, 9:53pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-train-gpt2-transformer-on-text-data%2F72325%2F1 "2024-02-07T21:53:54Z")

</div>

Hi,

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.
