Downloads · 30 days
17
17% of all-time downloads
Taykhoom/BERT-updated
BERT-updated is a feature extraction model from Taykhoom. Use it when you need embeddings to search or compare text. It is set up for transformers. The card lists the license as apache-2.0.
Standard BERT architecture with flashattention2 and sdpa support added.
Downloads · 30 days
17
17% of all-time downloads
All-time downloads
100
Public
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py22.2 KB · 81%
From the Hugging Face model README
Standard BERT architecture with flash_attention_2 and sdpa support added.
This is a shared code repository — it contains no pretrained weights. It is used as the code backend for biological sequence models that share the vanilla BERT architecture (post-LN transformer, learned absolute position embeddings) but have model-specific vocabularies and hyperparameters:
Each of those repos stores weights, tokenizer, and config; their auto_map in
config.json points here for the modeling code.
transformers.BertModelThe standard HF BertModel (transformers 4.57.6) supports sdpa but not
flash_attention_2. This repo adds a complete attn_implementation dispatch:
| Backend | Class | Notes |
|---|---|---|
eager | BertSelfAttention | Standard scaled dot-product, identical to original BERT |
sdpa | BertSdpaSelfAttention | F.scaled_dot_product_attention, bool mask -> additive float mask |
flash_attention_2 | BertFlashSelfAttention | flash_attn_varlen_func for padded inputs, flash_attn_func for unpadded |
The rest of the architecture (embeddings, FFN, pooler, weight layout) is unchanged.
See the full BERT-updated collection.
| Model | Purpose |
|---|---|
| BERT-updated | Shared BERT runtime |
| MosaicBERT-updated | Shared MosaicBERT runtime |
Do not load this repo directly. Load one of the model repos listed above:
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("Taykhoom/RNABERT", trust_remote_code=True)
model = AutoModel.from_pretrained("Taykhoom/RNABERT", trust_remote_code=True)
# Flash Attention 2
model = AutoModel.from_pretrained("Taykhoom/UTRBERT-3mer", trust_remote_code=True,
attn_implementation="flash_attention_2")
manually by Taykhoom Dalal.
Apache 2.0.