Views
No views yet
gena-lm-bert-base-t2t-multi) and DNABERT:1from transformers import AutoTokenizer, AutoModel
2
3tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bert-base-t2t-multi')
4model = AutoModel.from_pretrained('AIRI-Institute/gena-lm-bert-base-t2t-multi', 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-bert-base-t2t-multi')
5model = BertForSequenceClassification.from_pretrained('AIRI-Institute/gena-lm-bert-base-t2t-multi')1from transformers import AutoTokenizer, AutoModel
2model = AutoModel.from_pretrained('AIRI-Institute/gena-lm-bert-base-t2t-multi', 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-bert-base-t2t-multi', num_labels=2)gena-lm-bert-base-t2t-multi) 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-bert-base-t2t-multi is similar to the bert-base:gena-lm-bert-base-t2t-multi 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). We also add multispecies genomes from ENSEMBL release 108. The list of used species is here. Pre-training was performed for 1,925,000 iterations with batch size 256 and sequence length was equal to 512 tokens. We modified Transformer with Pre-Layer normalization, but without the final layer LayerNorm.1@article{GENA_LM,
2 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},
3 title = {GENA-LM: a family of open-source foundational DNA language models for long sequences},
4 journal = {Nucleic Acids Research},
5 volume = {53},
6 number = {2},
7 pages = {gkae1310},
8 year = {2025},
9 month = {01},
10 issn = {0305-1048},
11 doi = {10.1093/nar/gkae1310},
12 url = {https://doi.org/10.1093/nar/gkae1310},
13 eprint = {https://academic.oup.com/nar/article-pdf/53/2/gkae1310/61443229/gkae1310.pdf},
14}