Skip to content
fn

t5_small_seq2seq

→T5ForSeq2SeqLM60.5M
t5_small_seq2seq(pretrained: bool = False, overrides: object = {})

t5_small with the tied text-to-text head.

Model Size

Parameters

pretrainedbool= False
True raises until the T5-Small checkpoint is hosted for Lucid.
**overridesobject= {}
T5Config fields to change from the Small defaults.

Returns

T5ForSeq2SeqLM

The model T5 trains and fine-tunes every task with.

Notes

Reference: Raffel et al., JMLR 2020 (arXiv:1910.10683), §2.4 and §3.7.

Examples

>>> import lucid
>>> from lucid.models.text.t5 import t5_small_seq2seq
>>> model = t5_small_seq2seq().eval()
>>> source = lucid.tensor([[13, 5, 42, 1]])
>>> model(source, labels=lucid.tensor([[7, 9, 1]])).logits.shape
(1, 3, 32128)
>>> model.generate(source, max_length=4).shape[0]
1

Used by 1