torchcell.models.protT5.ProtT5

class ProtT5(model_name: str)[source]

Bases: PeptideModel

Rostlab ProtT5 encoder wrapper producing per-residue or mean embeddings.

property max_sequence_size: int

Return the maximum supported input sequence length.

load_model(model_name: str) → None[source]

Download if needed, then load the tokenizer and encoder onto the device.

embed(sequences: list[str], mean_embedding: bool = False) → Tensor[source]

Embed sequences, optionally mean-pooling each to a single vector.