Taykhoom commited on
Commit
46eba30
·
verified ·
1 Parent(s): b28609c

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +6 -8
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](<COLLECTION_URL>).
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 BertTokenizer, BertModel
73
 
74
- tokenizer = BertTokenizer.from_pretrained("Taykhoom/SpliceBERT-510nt")
75
- model = BertModel.from_pretrained("Taykhoom/SpliceBERT-510nt")
76
  model.eval()
77
 
78
- # Sequence must be exactly 510 nt; U->T conversion; space-separated
79
  seq = ("ATCGATCG" * 64)[:510] # exactly 510 nt
80
- seq_spaced = " ".join(list(seq.upper().replace("U", "T")))
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)