Downloads · 30 days
84
12% of all-time downloads
buetnlpbio/bpe-only-rna-bert
bpe-only-rna-bert is a fill-mask model from buetnlpbio. Use it when you need the model to fill a missing word. It is set up for transformers.
<span style="color:red"buetnlpbio/bpe-only-rna-bert is trained on BPE tokens only (for ablation). Please consider using buetnlpbio/birna-bert instead. </span
Downloads · 30 days
84
12% of all-time downloads
All-time downloads
702
Public
Repo size
937 MB
Likes
0
Public
Click a slice to open those files.
.bin468 MB · 100%
From the Hugging Face model README
<span style="color:red">buetnlpbio/bpe-only-rna-bert is trained on BPE tokens only (for ablation). Please consider using buetnlpbio/birna-bert instead.
</span>
BiRNA-BERT is a BERT-style transformer encoder model that generates embeddings for RNA sequences. BiRNA-BERT has been trained on BPE tokens and individual nucleotides. As a result, it can generate both granular nucleotide-level embeddings and efficient sequence-level embeddings (using BPE).
BiRNA-BERT was trained using the MosaicBERT framework - https://huggingface.co/mosaicml/mosaic-bert-base
import torch
import transformers
from transformers import AutoModelForMaskedLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("buetnlpbio/birna-tokenizer")
config = transformers.BertConfig.from_pretrained("buetnlpbio/bpe-only-rna-bert")
mysterybert = AutoModelForMaskedLM.from_pretrained("buetnlpbio/bpe-only-rna-bert",config=config,trust_remote_code=True)
mysterybert.cls = torch.nn.Identity()
# To get sequence embeddings
seq_embed = mysterybert(**tokenizer("AGCTACGTACGT", return_tensors="pt"))
print(seq_embed.logits.shape) # CLS + 4 BPE token embeddings + SEP