Instructions to use Taykhoom/SpliceBERT-510nt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Taykhoom/SpliceBERT-510nt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="Taykhoom/SpliceBERT-510nt", trust_remote_code=True)# Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("Taykhoom/SpliceBERT-510nt", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -57,7 +57,7 @@ Verified on GPU with PyTorch 2.7 / CUDA 11.8.
|
|
| 57 |
|
| 58 |
## Related Models
|
| 59 |
|
| 60 |
-
See the full [SpliceBERT collection](
|
| 61 |
|
| 62 |
| Model | Context | Training data | Notes |
|
| 63 |
|---|---|---|---|
|
|
@@ -69,17 +69,15 @@ See the full [SpliceBERT collection](<COLLECTION_URL>).
|
|
| 69 |
|
| 70 |
```python
|
| 71 |
import torch
|
| 72 |
-
from transformers import
|
| 73 |
|
| 74 |
-
tokenizer =
|
| 75 |
-
model =
|
| 76 |
model.eval()
|
| 77 |
|
| 78 |
-
# Sequence must be exactly 510 nt; U->T
|
| 79 |
seq = ("ATCGATCG" * 64)[:510] # exactly 510 nt
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
enc = tokenizer(seq_spaced, return_tensors="pt")
|
| 83 |
|
| 84 |
with torch.no_grad():
|
| 85 |
out = model(**enc, output_hidden_states=True)
|
|
|
|
| 57 |
|
| 58 |
## Related Models
|
| 59 |
|
| 60 |
+
See the full [SpliceBERT collection](https://huggingface.co/collections/Taykhoom/splicebert-6a20b72e9bec05b79ce009aa).
|
| 61 |
|
| 62 |
| Model | Context | Training data | Notes |
|
| 63 |
|---|---|---|---|
|
|
|
|
| 69 |
|
| 70 |
```python
|
| 71 |
import torch
|
| 72 |
+
from transformers import AutoTokenizer, AutoModel
|
| 73 |
|
| 74 |
+
tokenizer = AutoTokenizer.from_pretrained("Taykhoom/SpliceBERT-510nt", trust_remote_code=True)
|
| 75 |
+
model = AutoModel.from_pretrained("Taykhoom/SpliceBERT-510nt", trust_remote_code=True)
|
| 76 |
model.eval()
|
| 77 |
|
| 78 |
+
# Sequence must be exactly 510 nt; tokenizer handles U->T automatically
|
| 79 |
seq = ("ATCGATCG" * 64)[:510] # exactly 510 nt
|
| 80 |
+
enc = tokenizer(seq, return_tensors="pt")
|
|
|
|
|
|
|
| 81 |
|
| 82 |
with torch.no_grad():
|
| 83 |
out = model(**enc, output_hidden_states=True)
|