Views
No views yet
:)1# Install PyTorch (if not already installed)
2pip install torch
3
4# Install Flash Attention (optional, for best performance)
5pip install flash-attn --no-build-isolation --no-cache-dir
6
7# Install huggingface
8pip install transformerstrust_remote_code=True.1from transformers import AutoModelForMaskedLM, AutoTokenizer
2
3model = AutoModelForMaskedLM.from_pretrained("fredzzp/esm2_t33_650M_UR50D", trust_remote_code=True).to("cuda").eval().half()
4tokenizer = AutoTokenizer.from_pretrained("fredzzp/esm2_t33_650M_UR50D")
5
6input_ids = tokenizer("AGC", return_tensors="pt").input_ids.to("cuda")
7output = model(input_ids)
8print(output['logits'].shape)
9print(output['last_hidden_state'].shape)| Model | Num Layers | Num Parameters |
|---|---|---|
| fredzzp/esm2_t36_3B_UR50D | 36 | 3B |
| fredzzp/esm2_t33_650M_UR50D | 33 | 650M |
| fredzzp/esm2_t30_150M_UR50D | 30 | 150M |
| fredzzp/esm2_t12_35M_UR50D | 12 | 35M |
| fredzzp/esm2_t6_8M_UR50D | 6 | 8M |
1@article{lin2023evolutionary,
2 title={Evolutionary-scale prediction of atomic-level protein structure with a language model},
3 author={Lin, Zeming and Akin, Halil and Rao, Roshan and Hie, Brian and Zhu, Zihang and Lu, Wenting and Smetanin, Nikita and Verkuil, Robert and Kabeli, Ori and Shmueli, Yair and others},
4 journal={Science},
5 volume={379},
6 number={6637},
7 pages={1123--1130},
8 year={2023},
9 publisher={American Association for the Advancement of Science}
10}
11
12@misc{faesm2024,
13 author = {Fred Zhangzhi Peng, Pranam Chatterjee, and contributors},
14 title = {FAESM: An efficient PyTorch implementation of Evolutionary Scale Modeling (ESM)},
15 year = {2024},
16 howpublished = {\url{https://github.com/pengzhangzhi/faesm}},
17 note = {Efficient PyTorch implementation of ESM with FlashAttention and Scalar Dot-Product Attention (SDPA)},
18 abstract = {FAESM is a drop-in replacement for the official ESM implementation, designed to save up to 60% memory usage and 70% inference time, while maintaining compatibility with the ESM API.},
19}