/ Модель

Характеристики

Контекст
2 048 токенов
Параметры
121 млрд
Размер весов
50,3 ГБ
Архитектура
ProteinGLM · dense
Опубликована
6 июл 2024

proteinglm-100b-int4

Генерация текстаТекст → текст3 профессии

Крупная белковая языковая модель ProteinGLM в INT4-представлении для генерации и анализа аминокислотных последовательностей.

161скачиваний за 30 дней11лайковвеса обновлены17 мар 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

ProteinGLM-100B-INT4 — квантизированная до INT4 версия белковой языковой модели семейства ProteinGLM, разработанного исследователями Университета Цинхуа. Модель предназначена для анализа белковых последовательностей и проектирования белков: авторы описывают семейство как объединяющее masked language models для понимания белков и causal language models для генерации последовательностей. В README приведён пример генерации белковой последовательности по короткому аминокислотному префиксу.

Репозиторий содержит модель с 120,8 млрд параметров и контекстом 2048 токенов. Метаданные указывают архитектуру ProteinGLM и формат safetensors; README называет веса INT4. Примеры использования показывают интерфейсы Transformers для генерации, классификации последовательностей и токенов, а также получения представлений последовательности. Модель ориентирована на биологические последовательности, а не на обычный текстовый диалог.

README ссылается на работы о xTrimoPGLM и обучении белковых языковых моделей. Базовая модель в метаданных не указана, поэтому точную связь данного репозитория с конкретной исходной моделью установить нельзя. Лицензия в предоставленных данных не приведена. Для запуска README использует trust_remote_code и CUDA; практическое применение зависит от совместимого программного окружения и ресурсов для модели такого размера.

Сценарии применения

  • генерация белковых последовательностей по аминокислотному префиксу
  • анализ и представление белковых последовательностей
  • классификация белков на уровне последовательности
  • разметка отдельных токенов белковой последовательности
  • оценка правдоподобия белковых последовательностей

Ограничения

Предоставленные данные не содержат сведений о лицензии и количественных результатах оценки качества. Модель очень крупная; README указывает на использование CUDA и trust_remote_code в примерах.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

ProteinGLM

Introduction to ProteinGLM Family Models

ProteinGLM is the open-source version of the latest protein language models towards protein understanding tasks (Masked Protein Language Models) and protein design (Casual Protein Language Models). The ProteinGLM family models are developed by Tsinghua University. Along with this, we have released the int4 quantization ProteinGLM-100B weights and other small models, which include: 1B, 3B, and 10B models trained with masked language modeling for protein understanding, and 1B, 3B, and 7B causal language models aimed at protein design.

Out-of-Distribution Perplexity Evaluation

We evaluated the ProteinGLM (MLM or CLM) and ProteinGLM-INT4 (100B) models on two OOD test sets, one with sequence identity lower than 0.9 with the training set (<0.9 ID) and the other with sequence identity lower than 0.5 with the training set (<0.5 ID). Each OOD dataset comprises approximately 10,000 protein sequences. The MLM perplexity results, compared against ESM2-3B and ESM2-15B and the CLM perplexity againest ProGen2-xlarge (6.4B), are as follows (lower is better):

ModelESM2(3B)ESM2 (15B)PGLM (1B)PGLM (3B)PGLM (10B)PGLM-INT4 (100B)
< 0.9 ID7.77.39.37.87.66.8
< 0.5 ID11.511.013.511.911.610.8
ModelProGen2-xlarge (6.4B)PGLM (1B)PGLM (3B)PGLM (7B)PGLM-INT4 (100B)
< 0.9 ID9.79.89.38.98.9
< 0.5 ID14.314.013.713.513.5

Downstream Protein Understanding Tasks Evaluation

(TODO)

Get Started

Model List

You can choose to manually download the necessary weights

ModelDownload
ProteinGLM-1B-MLM🤗 Huggingface
ProteinGLM-3B-MLM🤗 Huggingface
ProteinGLM-10B-MLM🤗 Huggingface
ProteinGLM-1B-CLM🤗 Huggingface
ProteinGLM-3B-CLM🤗 Huggingface
ProteinGLM-7B-CLM🤗 Huggingface
ProteinGLM-INT4 (100B) (MLM or CLM)🤗 Huggingface

How to use

ProteinGLM-MLM: Masked Langeuage Models for Protein Understanding Tasks

(The ProteinGLM-100B INT4 quantization requires approximately 50 GB of GPU memory. It can be inferred on a single A100/800 GPU with 80 GB of memory or across multiple GPUs totaling 60 GB.)


# Obtain residue embeddings
from transformers import AutoModelForMaskedLM, AutoModelForSequenceClassification, AutoModelForTokenClassification, AutoTokenizer, AutoConfig
import torch

tokenizer  = AutoTokenizer.from_pretrained("Bo1015/proteinglm-100b-int4", trust_remote_code=True, use_fast=True)
config = AutoConfig.from_pretrained("Bo1015/proteinglm-100b-int4",  trust_remote_code=True, torch_dtype=torch.half)
config.is_causal=False
config.post_layer_norm=True # use the final layernorm or not, some tasks set to false would be better.
model = AutoModelForMaskedLM.from_pretrained("Bo1015/proteinglm-100b-int4", config = config, torch_dtype=torch.half,trust_remote_code=True)
if torch.cuda.is_available():
    model = model.cuda()

# # if you don't have the single gpu with 80G memory, try the dispatch load.
# from accelerate import load_checkpoint_and_dispatch, init_empty_weights
# with init_empty_weights():
  # model = AutoModelForMaskedLM.from_config(config, trust_remote_code=True)
# 
# model = load_checkpoint_and_dispatch(
#     model, "<your model cached dir>", device_map="auto", no_split_module_classes=["xTrimoPGLMBlock"], strict=True, dtype=dtype
# )

model.eval()

seq = 'MILMCQHFSGQFSKYFLAVSSDFCHFVFPIILVSHVNFKQMKRKGFALWNDRAVPFTQGIFTTVMILLQYLHGTG'
output = tokenizer(seq, add_special_tokens=True, return_tensors='pt')
with torch.inference_mode():
    inputs = {"input_ids": output["input_ids"].cuda(), "attention_mask": output["attention_mask"].cuda()}
    output_embeddings = model(**inputs, output_hidden_states=True, return_last_hidden_state=True).hidden_states[:-1, 0] # get rid of the <eos> token


# model for the sequence-level tasks
model = AutoModelForSequenceClassification.from_pretrained(config, trust_remote_code=True, torch_dtype=torch.half)

# model for the token-level tasks
model = AutoModelForTokenClassification.from_pretrained(config, trust_remote_code=True, torch_dtype=torch.half)

ProteinGLM-CLM: Casusal Langeuage Models for Protein Design

from transformers import AutoModelForCausalLM, AutoTokenizer, AutoConfig
import torch

tokenizer  = AutoTokenizer.from_pretrained("Bo1015/proteinglm-100b-int4", trust_remote_code=True, use_fast=True)
config = AutoConfig.from_pretrained("Bo1015/proteinglm-100b-int4",  trust_remote_code=True, torch_dtype=torch.half)
config.is_causal=True
model = AutoModelForCausalLM.from_pretrained("Bo1015/proteinglm-100b-int4", config = config, torch_dtype=torch.half,trust_remote_code=True)
if torch.cuda.is_available():
    model = model.cuda()

# # if you don't have the single gpu with 80G memory, try the dispatch load.
# from accelerate import load_checkpoint_and_dispatch, init_empty_weights
# with init_empty_weights():
  # model = AutoModelForMaskedLM.from_config(config, trust_remote_code=True)
# 
# model = load_checkpoint_and_dispatch(
#     model, "<your model cached dir>", device_map="auto", no_split_module_classes=["xTrimoPGLMBlock"], strict=True, dtype=dtype
# )
model.eval()

gen_kwargs = {'max_length': 256, 'top_p': 0.8, 'temperature':0.9, "num_beams": 1}
prompt=['', 'MLFVVL', 'LDL', 'VTQA']

for idx, each in enumerate(prompt):
    print(f"Begin generating idx: {idx} with prompt {each}")
    output = model.chat(tokenizer, each, **gen_kwargs)
    print(f"\nEnd generation with length: {len(output.split())} - seqs: {output}\n")

LICENSE

The model in this repository is open source under the Creative Commons Attribution-NonCommercial 4.0 International License.

Citations

If you find our work useful, please consider citing the following paper:

@misc{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},
  year={2024},
  eprint={2401.06199},
  archivePrefix={arXiv},
  primaryClass={cs.CL},
  note={arXiv preprint arXiv:2401.06199}
}

@misc{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},
  year={2024},
  note={bioRxiv, Cold Spring Harbor Laboratory, pages 2024--06}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
ProteinGLMModel
Ревизия весов
5d6753d

0 моделей