Downloads · 30 days
109
7% of all-time downloads
AIRI-Institute/gena-lm-bigbird-base-sparse-t2t
gena-lm-bigbird-base-sparse-t2t is a fill-mask model from AIRI-Institute. Use it when you need the model to fill a missing word. It is set up for transformers.
GENA-LM is a Family of Open-Source Foundational Models for Long DNA Sequences.
Downloads · 30 days
109
7% of all-time downloads
All-time downloads
1.6K
Public
Repo size
1.1 GB
Likes
7
Public
Click a slice to open those files.
.bin557 MB · 100%
From the Hugging Face model README
GENA-LM is a Family of Open-Source Foundational Models for Long DNA Sequences.
GENA-LM models are transformer masked language models trained on human DNA sequence.
gena-lm-bigbird-base-sparse-t2t follows the BigBird architecture and uses sparse attention from DeepSpeed.
Differences between GENA-LM (gena-lm-bigbird-base-sparse-t2t) and DNABERT:
Source code and data: https://github.com/AIRI-Institute/GENA_LM
Paper: https://academic.oup.com/nar/article/53/2/gkae1310/7954523
gena-lm-bigbird-base-sparse-t2t sparse ops require DeepSpeed.
DeepSpeed installation is needed to work with SparseAttention versions of language models. DeepSpeed Sparse attention supports only GPUs with compute compatibility >= 7 (V100, T4, A100).
pip install triton==1.0.0
DS_BUILD_SPARSE_ATTN=1 pip install deepspeed==0.6.0 --global-option="build_ext" --global-option="-j8" --no-cache
and check installation with
ds_report
Install APEX https://github.com/NVIDIA/apex#quick-start
git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-sparse-t2t')
model = AutoModel.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-sparse-t2t', trust_remote_code=True)
Get model class from GENA-LM repository:
git clone https://github.com/AIRI-Institute/GENA_LM.git
from GENA_LM.src.gena_lm.modeling_bert import BertForSequenceClassification
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-sparse-t2t')
model = BertForSequenceClassification.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-sparse-t2t')
or you can just download modeling_bert.py and put it close to your code.
OR you can get model class from HuggingFace AutoModel:
from transformers import AutoTokenizer, AutoModel
model = AutoModel.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-sparse-t2t', trust_remote_code=True)
gena_module_name = model.__class__.__module__
print(gena_module_name)
import importlib
# available class names:
# - BertModel, BertForPreTraining, BertForMaskedLM, BertForNextSentencePrediction,
# - BertForSequenceClassification, BertForMultipleChoice, BertForTokenClassification,
# - BertForQuestionAnswering
# check https://huggingface.co/docs/transformers/model_doc/bert
cls = getattr(importlib.import_module(gena_module_name), 'BertForSequenceClassification')
print(cls)
model = cls.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-sparse-t2t', num_labels=2)
GENA-LM (gena-lm-bigbird-base-sparse-t2t) model is trained in a masked language model (MLM) fashion, following the methods proposed in the BigBird paper by masking 15% of tokens. Model config for gena-lm-bigbird-base-sparse-t2t is similar to the google/bigbird-roberta-base:
We pre-trained gena-lm-bigbird-base-sparse-t2t using the latest T2T human genome assembly (https://www.ncbi.nlm.nih.gov/assembly/GCA_009914755.3/). The data was augmented by sampling mutations from 1000-genome SNPs (gnomAD dataset). Pre-training was performed for 800,000 iterations with batch size 256. We modified Transformer with Pre-Layer normalization.
For evaluation results, see our paper: https://academic.oup.com/nar/article/53/2/gkae1310/7954523
@article{GENA_LM,
author = {Fishman, Veniamin and Kuratov, Yuri and Shmelev, Aleksei and Petrov, Maxim and Penzar, Dmitry and Shepelin, Denis and Chekanov, Nikolay and Kardymon, Olga and Burtsev, Mikhail},
title = {GENA-LM: a family of open-source foundational DNA language models for long sequences},
journal = {Nucleic Acids Research},
volume = {53},
number = {2},
pages = {gkae1310},
year = {2025},
month = {01},
issn = {0305-1048},
doi = {10.1093/nar/gkae1310},
url = {https://doi.org/10.1093/nar/gkae1310},
eprint = {https://academic.oup.com/nar/article-pdf/53/2/gkae1310/61443229/gkae1310.pdf},
}