Exscientia / IgT5_unpaired

huggingface.co
Total runs: 170
24-hour runs: 0
7-day runs: 72
30-day runs: 124
Model's Last Updated: Junho 14 2024
text2text-generation

Introduction of IgT5_unpaired

Model Details of IgT5_unpaired

IgT5 unpaired model

Model pretrained on protein and antibody sequences using a masked language modeling (MLM) objective. It was introduced in the paper Large scale paired antibody language models .

The model is finetuned from ProtT5 using unpaired antibody sequences from the Observed Antibody Space .

Use

The encoder part of the model and tokeniser can be loaded using the transformers library

from transformers import T5EncoderModel, T5Tokenizer

tokeniser = T5Tokenizer.from_pretrained("Exscientia/IgT5_unpaired", do_lower_case=False)
model = T5EncoderModel.from_pretrained("Exscientia/IgT5_unpaired")

The tokeniser is used to prepare batch inputs

# single chain sequences
sequences = [
    "EVVMTQSPASLSVSPGERATLSCRARASLGISTDLAWYQQRPGQAPRLLIYGASTRATGIPARFSGSGSGTEFTLTISSLQSEDSAVYYCQQYSNWPLTFGGGTKVEIK",
    "ALTQPASVSGSPGQSITISCTGTSSDVGGYNYVSWYQQHPGKAPKLMIYDVSKRPSGVSNRFSGSKSGNTASLTISGLQSEDEADYYCNSLTSISTWVFGGGTKLTVL"
]

# The tokeniser expects input of the form ["E V V M...", "A L T Q..."]
sequences = [' '.join(sequence) for sequence in sequences] 

tokens = tokeniser.batch_encode_plus(
    sequences, 
    add_special_tokens=True, 
    pad_to_max_length=True, 
    return_tensors="pt",
    return_special_tokens_mask=True
) 

Note that the tokeniser adds a </s> token at the end of each sequence and pads using the <pad> token. For example a batch containing sequences E V V M , A L will be tokenised to E V V M </s> and A L </s> <pad> <pad> .

Sequence embeddings are generated by feeding tokens through the model

output = model(
    input_ids=tokens['input_ids'], 
    attention_mask=tokens['attention_mask']
)

residue_embeddings = output.last_hidden_state

To obtain a sequence representation, the residue tokens can be averaged over like so

import torch

# mask special tokens before summing over embeddings
residue_embeddings[tokens["special_tokens_mask"] == 1] = 0
sequence_embeddings_sum = residue_embeddings.sum(1)

# average embedding by dividing sum by sequence lengths
sequence_lengths = torch.sum(tokens["special_tokens_mask"] == 0, dim=1)
sequence_embeddings = sequence_embeddings_sum / sequence_lengths.unsqueeze(1)

Runs of Exscientia IgT5_unpaired on huggingface.co

170
Total runs
0
24-hour runs
20
3-day runs
72
7-day runs
124
30-day runs

More Information About IgT5_unpaired huggingface.co Model

More IgT5_unpaired license Visit here:

https://choosealicense.com/licenses/mit

IgT5_unpaired huggingface.co

IgT5_unpaired huggingface.co is an AI model on huggingface.co that provides IgT5_unpaired's model effect (), which can be used instantly with this Exscientia IgT5_unpaired model. huggingface.co supports a free trial of the IgT5_unpaired model, and also provides paid use of the IgT5_unpaired. Support call IgT5_unpaired model through api, including Node.js, Python, http.

Exscientia IgT5_unpaired online free

IgT5_unpaired huggingface.co is an online trial and call api platform, which integrates IgT5_unpaired's modeling effects, including api services, and provides a free online trial of IgT5_unpaired, you can try IgT5_unpaired online for free by clicking the link below.

Exscientia IgT5_unpaired online free url in huggingface.co:

https://huggingface.co/Exscientia/IgT5_unpaired

IgT5_unpaired install

IgT5_unpaired is an open source model from GitHub that offers a free installation service, and any user can find IgT5_unpaired on GitHub to install. At the same time, huggingface.co provides the effect of IgT5_unpaired install, users can directly use IgT5_unpaired installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

IgT5_unpaired install url in huggingface.co:

https://huggingface.co/Exscientia/IgT5_unpaired

Url of IgT5_unpaired

IgT5_unpaired huggingface.co Url

Provider of IgT5_unpaired huggingface.co

Exscientia
ORGANIZATIONS

Other API from Exscientia

huggingface.co

Total runs: 15.9K
Run Growth: -2.9K
Growth Rate: -18.40%
Updated: Junho 19 2024
huggingface.co

Total runs: 6.9K
Run Growth: -4.3K
Growth Rate: -101.38%
Updated: Junho 14 2024