Search code examples
machine-learningartificial-intelligenceopenai-apilanguage-modelgpt-2

I want to make an AI text classifier using OpenAI API, based on GPT2 but i cannot find the API documentation for the GPT2


I wanted to create an AI text classifier project for my college, I wanted to use GPT2 API for the same as it is more reliable to catch the content generated by GPT 3.5, so how can I use GPT2 documentation? also any useful resources for the same are welcome

I tried going through model section of the documentation but couldn't find for GPT2, there's only for GPT 3.5


Solution

  • GPT-2 is not available through the OpenAI api, only GPT-3 and above so far. I would recommend accessing the model through the Huggingface Transformers library, and they have some documentation out there but it is sparse. There are some tutorials you can google and find, but they are a bit old, which is to be expected since the model came out years ago now. Also, what do you mean by, "I wanted to use GPT2 API for the same as it is more reliable to catch the content generated by GPT 3.5"? By all accounts, GPT-3 should be much better than GPT-2 at text classification, and by signing up for a free trial with OpenAI you can use their API for free (with provided credits for only three months). If you want to train the GPT-2 XL model, you will probably get better results than GPT-3's Ada, but then you have Compute resources you have to worry about.