Views
No views yet
gena-lm-bigbird-base-sparse follows the BigBird architecture and uses sparse attention from DeepSpeed.gena-lm-bigbird-base-sparse) and DNABERT:gena-lm-bigbird-base-sparse sparse ops require DeepSpeed.1pip install triton==1.0.0
2DS_BUILD_SPARSE_ATTN=1 pip install deepspeed==0.6.0 --global-option="build_ext" --global-option="-j8" --no-cacheds_reportgit 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" ./1from transformers import AutoTokenizer, AutoModel
2
3tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-sparse')
4model = AutoModel.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-sparse', trust_remote_code=True)
5git clone https://github.com/AIRI-Institute/GENA_LM.git1from GENA_LM.src.gena_lm.modeling_bert import BertForSequenceClassification
2from transformers import AutoTokenizer
3
4tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-sparse')
5model = BertForSequenceClassification.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-sparse')1from transformers import AutoTokenizer, AutoModel
2model = AutoModel.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-sparse', trust_remote_code=True)
3gena_module_name = model.__class__.__module__
4print(gena_module_name)
5import importlib
6# available class names:
7# - BertModel, BertForPreTraining, BertForMaskedLM, BertForNextSentencePrediction,
8# - BertForSequenceClassification, BertForMultipleChoice, BertForTokenClassification,
9# - BertForQuestionAnswering
10# check https://huggingface.co/docs/transformers/model_doc/bert
11cls = getattr(importlib.import_module(gena_module_name), 'BertForSequenceClassification')
12print(cls)
13model = cls.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-sparse', num_labels=2)gena-lm-bigbird-base-sparse) 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 is similar to the google/bigbird-roberta-base:gena-lm-bigbird-base-sparse using the latest T2T human genome assembly (https://www.ncbi.nlm.nih.gov/assembly/GCA_009914755.3/). Pre-training was performed for 810,000 iterations with batch size 256. We modified Transformer with Pre-Layer normalization.1@article{GENA_LM,
2 author = {Veniamin Fishman and Yuri Kuratov and Maxim Petrov and Aleksei Shmelev and Denis Shepelin and Nikolay Chekanov and Olga Kardymon and Mikhail Burtsev},
3 title = {GENA-LM: A Family of Open-Source Foundational Models for Long DNA Sequences},
4 elocation-id = {2023.06.12.544594},
5 year = {2023},
6 doi = {10.1101/2023.06.12.544594},
7 publisher = {Cold Spring Harbor Laboratory},
8 URL = {https://www.biorxiv.org/content/early/2023/06/13/2023.06.12.544594},
9 eprint = {https://www.biorxiv.org/content/early/2023/06/13/2023.06.12.544594.full.pdf},
10 journal = {bioRxiv}
11}