GPT-2 Large
Lucid port of transformers/gpt2-large,
converted to Lucid-native safetensors.
Available weights
| Tag | Params | GFLOPs | Size | Source |
|---|---|---|---|---|
WEBTEXT (default) |
774.0M | โ | 2952.73 MB | transformers |
Usage
import lucid
import lucid.models as models
from lucid.models.weights import GPT2LargeWeights
# default tag
model = models.gpt2_large(pretrained=True)
# explicit tag (enum or string)
model = models.gpt2_large(weights=GPT2LargeWeights.WEBTEXT)
model = models.gpt2_large(pretrained="WEBTEXT")
# feed token ids (tokenize with the matching lucid.utils.tokenizer)
input_ids = lucid.tensor([[101, 7592, 2088, 102]], dtype=lucid.int64)
out = model(input_ids)
hidden = out.last_hidden_state # (B, T, hidden_size)
Conversion
Converted from transformers/gpt2-large via
python -m tools.convert_weights gpt2_large --tag WEBTEXT.
Key mapping + numerical parity verified against the source.
License
mit โ inherited from the original weights.
Citation
Radford et al., "Language Models are Unsupervised Multitask Learners", 2019 (GPT-2).