CoolFace
Modelpublic

lucid-dl/gpt2-xlarge

sourceHugging Facemitupdated 4mo agoView on Hugging Face
0likes
Model Card

GPT-2 XL

https://cdn.openai.com/better-language-models/languagemodelsareunsupervisedmultitask_learners.pdf

Lucid port of transformers/gpt2-xl, converted to Lucid-native safetensors.

Available weights

TagParamsGFLOPsSizeSource
WEBTEXT (default)1557.6M—5941.87 MBtransformers

Usage

python
import lucid
import lucid.models as models
from lucid.models.weights import GPT2XLargeWeights

# default tag
model = models.gpt2_xlarge(pretrained=True)

# explicit tag (enum or string)
model = models.gpt2_xlarge(weights=GPT2XLargeWeights.WEBTEXT)
model = models.gpt2_xlarge(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-xl via python -m tools.convert_weights gpt2_xlarge --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).