GPT-2 Medium (causal-LM)

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

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

Available weights

Tag Params GFLOPs Size Source
WEBTEXT (default) 354.8M โ€” 1549.89 MB transformers

Usage

import lucid
import lucid.models as models
from lucid.models.weights import GPT2MediumLMWeights

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

# explicit tag (enum or string)
model = models.gpt2_medium_lm(weights=GPT2MediumLMWeights.WEBTEXT)
model = models.gpt2_medium_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-medium via python -m tools.convert_weights gpt2_medium_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).
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support