Downloads · 30 days
71
0% of all-time downloads
westlake-repl/SaProt_35M_AF2_seqOnly
SaProt_35M_AF2_seqOnly is a fill-mask model from westlake-repl. Use it when you need the model to fill a missing word. It is set up for transformers. The card lists the license as mit.
This model is provided to compare with official ESM-2 35M model. It only receives residue sequence but shares the same vocabulary with normal SaProt, which means all structure(3Di) tokens are marked as during training.
Downloads · 30 days
71
0% of all-time downloads
All-time downloads
77K
Public
Repo size
274 MB
Likes
1
Public
Click a slice to open those files.
.bin137 MB · 100%
From the Hugging Face model README
This model is provided to compare with official ESM-2 35M model. It only receives residue sequence but shares the same vocabulary with normal SaProt,
which means all structure(3Di) tokens are marked as # during training.
The following code shows how to load the model.
from transformers import EsmTokenizer, EsmForMaskedLM
model_path = "/your/path/to/SaProt_35M_AF2_seqOnly"
tokenizer = EsmTokenizer.from_pretrained(model_path)
model = EsmForMaskedLM.from_pretrained(model_path)
#################### Example ####################
device = "cuda"
model.to(device)
seq = "M#E#V#Q#L#V#Q#Y#K#"
tokens = tokenizer.tokenize(seq)
print(tokens)
inputs = tokenizer(seq, return_tensors="pt")
inputs = {k: v.to(device) for k, v in inputs.items()}
outputs = model(**inputs)
print(outputs.logits.shape)
"""
['M#', 'E#', 'V#', 'Q#', 'L#', 'V#', 'Q#', 'Y#', 'K#']
torch.Size([1, 11, 446])
"""