Commit ·
54638bc
1
Parent(s): e039883
upload readme
Browse files
README.md
CHANGED
|
@@ -1 +1,25 @@
|
|
| 1 |
-
# Ankh 3 XL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ankh 3 XL
|
| 2 |
+
|
| 3 |
+
```python
|
| 4 |
+
from transformers import AutoTokenizer, AutoModel, T5EncoderModel, T5Tokenizer
|
| 5 |
+
import torch
|
| 6 |
+
|
| 7 |
+
tokenizer = T5Tokenizer.from_pretrained("ElnaggarLab/ankh3-xl")
|
| 8 |
+
encoder = T5EncoderModel.from_pretrained("ElnaggarLab/ankh3-xl")
|
| 9 |
+
protenrich = AutoModel.from_pretrained("SaeedLab/ProtEnrich-Ankh3", trust_remote_code=True)
|
| 10 |
+
|
| 11 |
+
seqs = "MKTFFVLLL"
|
| 12 |
+
seqs = "[NLU]" + seqs
|
| 13 |
+
inputs = tokenizer([seqs], return_tensors="pt", padding=True)
|
| 14 |
+
|
| 15 |
+
with torch.no_grad():
|
| 16 |
+
outputs = encoder(**inputs)
|
| 17 |
+
pooled = outputs.last_hidden_state[0, 1:-1].mean(axis=0)
|
| 18 |
+
enriched = protenrich(pooled)
|
| 19 |
+
|
| 20 |
+
print('H enrich:', enriched.h_enrich)
|
| 21 |
+
print('H anchor:', enriched.h_anchor)
|
| 22 |
+
print('H algn:', enriched.h_algn)
|
| 23 |
+
print('Structure:', enriched.struct)
|
| 24 |
+
print('Dynamics:', enriched.dyn)
|
| 25 |
+
```
|