Views
No views yet
| Parameter | Value |
|---|---|
| Layers | 12 |
| Attention heads | 12 |
| Embedding dimension | 768 |
| FFN hidden dimension | 3072 (GELU) |
| Vocabulary size | 25 |
| Positional encoding | Sinusoidal (fairseq-style) |
| Normalization | LayerNorm (embedding and post-residual) |
| Architecture | Post-LN Transformer with recurrent 2D RNA pairing bias |
| Max sequence length | 1024 |
ERNIE-RNA-UTR_ML_CNN.ptattn_implementation="eager" is supported (see Implementation Notes).| Model | Notes |
|---|---|
| Taykhoom/ERNIE-RNA | Pretrained model |
| Taykhoom/ERNIE-RNA-SS | SS fine-tuned |
| Taykhoom/ERNIE-RNA-MRL | This model -- UTR MRL fine-tuned |
1import torch
2from transformers import AutoTokenizer, AutoModel
3
4tokenizer = AutoTokenizer.from_pretrained("Taykhoom/ERNIE-RNA-MRL", trust_remote_code=True)
5model = AutoModel.from_pretrained("Taykhoom/ERNIE-RNA-MRL", trust_remote_code=True)
6model.eval()
7
8sequences = ["AUGCAUGCAUGC", "GGGGCCCCGGGG"]
9enc = tokenizer(sequences, return_tensors="pt", padding=True)
10
11with torch.no_grad():
12 out = model(**enc)
13
14cls_emb = out.last_hidden_state[:, 0, :] # (batch, 768) -- CLS token
15token_emb = out.last_hidden_state # (batch, seq_len, 768)
16
17# Intermediate layers
18out_all = model(**enc, output_hidden_states=True)
19layer6_emb = out_all.hidden_states[6] # (batch, seq_len, 768)1import torch
2from transformers import AutoTokenizer, AutoModelForMaskedLM
3
4tokenizer = AutoTokenizer.from_pretrained("Taykhoom/ERNIE-RNA-MRL", trust_remote_code=True)
5model = AutoModelForMaskedLM.from_pretrained(
6 "Taykhoom/ERNIE-RNA-MRL", trust_remote_code=True
7)
8model.eval()
9
10enc = tokenizer(["AUGC<mask>UGCA"], return_tensors="pt")
11with torch.no_grad():
12 logits = model(**enc).logits # (1, seq_len, 25)last_hidden_state[:, 0, :]) as input to a prediction head
for sequence-level tasks. The original MRL regression head is not included.attn_implementation="eager" is supported; requesting sdpa or
flash_attention_2 raises a ValueError.twod_proj MLP is always run in float32 (matching the original) regardless of the
model's compute dtype.1@article{yin2025_ernierna,
2 title = {{ERNIE-RNA}: an {RNA} language model with structure-enhanced representations},
3 author = {Yin, Weijie and Zhang, Zhaoyu and Zhang, Shuo and He, Liang and Zhang, Ruiyang and Jiang, Rui and Liu, Gan and Wang, Jingyi and Zhang, Xuegong and Qin, Tao and Xie, Zhen},
4 journal = {Nature Communications},
5 volume = {16},
6 number = {1},
7 pages = {8407},
8 year = {2025},
9 doi = {10.1038/s41467-025-64972-0}
10}