Views
No views yet
| Model | ProGen2-xlarge (6.4B) | PGLM (1B) | PGLM (3B) | PGLM (7B) | PGLM-INT4 (100B) |
|---|---|---|---|---|---|
| < 0.9 ID | 9.7 | 9.8 | 9.3 | 8.9 | 8.7 |
| < 0.5 ID | 14.3 | 14.0 | 13.7 | 13.5 | 13.3 |
1from transformers import AutoModelForCausalLM, AutoTokenizer, AutoConfig
2import torch
3
4tokenizer = AutoTokenizer.from_pretrained("proteinglm/proteinglm-3b-clm", trust_remote_code=True, use_fast=True)
5model = AutoModelForCausalLM.from_pretrained("proteinglm/proteinglm-3b-clm", trust_remote_code=True, torch_dtype=torch.bfloat16)
6if torch.cuda.is_available():
7 model = model.cuda()
8model.eval()
9
10gen_kwargs = {'max_length': 256, 'top_p': 0.8, 'temperature':0.9, "num_beams": 1}
11prompt=['', 'MLFVVL', 'LDL', 'VTQA']
12
13for idx, each in enumerate(prompt):
14 print(f"Begin generating idx: {idx} with prompt {each}")
15 output = model.chat(tokenizer, each, **gen_kwargs)
16 print(f"\nEnd generation with length: {len(output.split())} - seqs: {output}\n")@article{chen2024xtrimopglm,
title={xTrimoPGLM: unified 100B-scale pre-trained transformer for deciphering the language of protein},
author={Chen, Bo and Cheng, Xingyi and Li, Pan and Geng, Yangli-ao and Gong, Jing and Li, Shen and Bei, Zhilei and Tan, Xu and Wang, Boyan and Zeng, Xin and others},
journal={arXiv preprint arXiv:2401.06199},
year={2024}
}
@article{cheng2024training,
title={Training Compute-Optimal Protein Language Models},
author={Cheng, Xingyi and Chen, Bo and Li, Pan and Gong, Jing and Tang, Jie and Song, Le},
journal={bioRxiv},
pages={2024--06},
year={2024},
publisher={Cold Spring Harbor Laboratory}
}