This model was trained using the
AMPLIFY training codebase. The original models and code were released under
chandar-lab/AMPLIFY. See also
flair-bio/AMPLIFY_350M.
1from transformers import AutoModelForMaskedLM, AutoTokenizer
2
3model = AutoModelForMaskedLM.from_pretrained("flair-bio/amplify-120m", trust_remote_code=True)
4tokenizer = AutoTokenizer.from_pretrained("flair-bio/amplify-120m", trust_remote_code=True)
5model.eval()
1import torch
2from transformers import AutoModel, AutoTokenizer
3
4tokenizer = AutoTokenizer.from_pretrained("flair-bio/amplify-120m", trust_remote_code=True)
5model = AutoModel.from_pretrained("flair-bio/amplify-120m", trust_remote_code=True)
6
7sequences = ["MKTAYIAK", "MVLSPADKTNVK"]
8inputs = tokenizer(sequences, return_tensors="pt", padding=True, truncation=True, max_length=2048)
9
10with torch.no_grad():
11 outputs = model(**inputs)
12
13embeddings = outputs.last_hidden_state # [batch, seq_len, 640]
1from transformers import AutoTokenizer, AutoModelForMaskedLM
2import torch
3
4tokenizer = AutoTokenizer.from_pretrained("flair-bio/amplify-120m", trust_remote_code=True)
5model = AutoModelForMaskedLM.from_pretrained("flair-bio/amplify-120m", trust_remote_code=True)
6
7sequence = "MKTAY<mask>AKQRQISFVK"
8inputs = tokenizer(sequence, return_tensors="pt")
9
10with torch.no_grad():
11 logits = model(**inputs).logits
12
13mask_idx = (inputs["input_ids"] == tokenizer.mask_token_id).nonzero(as_tuple=True)[1]
14predicted = tokenizer.decode(logits[0, mask_idx].argmax(dim=-1))
15print(predicted)
AMPLIFY 120M is a BERT-style transformer encoder with 24 layers, 640-dimensional hidden states, and 10 attention heads. It uses rotary positional embeddings (RoPE), SwiGLU feed-forward blocks, and RMSNorm. Tokenization is at the amino acid level with a vocabulary of 32 tokens.
This model is intended for extracting per-residue or per-sequence representations for downstream tasks, zero-shot variant effect prediction via pseudo-log-likelihood scoring, and fine-tuning on protein fitness, stability, binding, or functional annotation tasks.
Pre-trained on
UR100P (
chandar-lab/UR100P), a deduplicated union of UniRef100, OAS, and SCOPe.
Training logs are available on
Weights & Biases.
1@article{Fournier2024.09.23.614603,
2 title = {Protein Language Models: Is Scaling Necessary?},
3 author = {Fournier, Quentin and Vernon, Robert M. and van der Sloot, Almer and Schulz, Benjamin and Chandar, Sarath and Langmead, Christopher James},
4 year = {2024},
5 journal = {bioRxiv},
6 publisher = {Cold Spring Harbor Laboratory},
7 doi = {10.1101/2024.09.23.614603},
8 url = {https://www.biorxiv.org/content/early/2024/09/23/2024.09.23.614603}
9}