GPT-2 XL (causal-LM)
Lucid port of transformers/gpt2-xl,
converted to Lucid-native safetensors.
Available weights
| Tag | Params | GFLOPs | Size | Source |
|---|---|---|---|---|
WEBTEXT (default) |
1557.6M | โ | 6248.62 MB | transformers |
Usage
import lucid
import lucid.models as models
from lucid.models.weights import GPT2XLargeLMWeights
# default tag
model = models.gpt2_xlarge_lm(pretrained=True)
# explicit tag (enum or string)
model = models.gpt2_xlarge_lm(weights=GPT2XLargeLMWeights.WEBTEXT)
model = models.gpt2_xlarge_lm(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)
logits = out.logits # (B, T, vocab_size)
Conversion
Converted from transformers/gpt2-xl via
python -m tools.convert_weights gpt2_xlarge_lm --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).