Views
No views yet
transformers/gpt2-medium,
converted to Lucid-native safetensors.| Tag | Params | GFLOPs | Size | Source |
|---|---|---|---|---|
WEBTEXT (default) | 354.8M | — | 1353.57 MB | transformers |
1import lucid
2import lucid.models as models
3from lucid.models.weights import Gpt2MediumWeights
4
5# default tag
6model = models.gpt2_medium(pretrained=True)
7
8# explicit tag (enum or string)
9model = models.gpt2_medium(weights=Gpt2MediumWeights.WEBTEXT)
10model = models.gpt2_medium(pretrained="WEBTEXT")
11
12# feed token ids (tokenize with the matching lucid.utils.tokenizer)
13input_ids = lucid.tensor([[101, 7592, 2088, 102]], dtype=lucid.int64)
14out = model(input_ids)
15hidden = out.last_hidden_state # (B, T, hidden_size)transformers/gpt2-medium via
python -m tools.convert_weights gpt2_medium --tag WEBTEXT.
Key mapping + numerical parity verified against the source.mit — inherited from the original weights.Radford et al., "Language Models are Unsupervised Multitask Learners", 2019 (GPT-2).