updating model peptriever_2023-06-23T16:07:24.508460
Browse files
README.md
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: en
|
3 |
+
license: mit
|
4 |
+
datasets:
|
5 |
+
- ronig/protein_binding_sequences
|
6 |
+
---
|
7 |
+
# Protein BiEncoder Bert Model
|
8 |
+
|
9 |
+
Usage
|
10 |
+
```python
|
11 |
+
tokenizer = AutoTokenizer.from_pretrained("ronig/protein_biencoder")
|
12 |
+
model = BiEncoder.from_pretrained("ronig/protein_biencoder")
|
13 |
+
model.eval()
|
14 |
+
|
15 |
+
peptide_sequence = "AAA"
|
16 |
+
protein_sequence = "MMM"
|
17 |
+
encoded_peptide = tokenizer.encode_plus(peptide_sequence, return_tensors='pt')
|
18 |
+
encoded_protein = tokenizer.encode_plus(protein_sequence, return_tensors='pt')
|
19 |
+
|
20 |
+
with torch.no_grad():
|
21 |
+
peptide_output = model.forward1(encoded_peptide)
|
22 |
+
protein_output = model.forward2(encoded_protein)
|
23 |
+
|
24 |
+
print("distance: ", torch.norm(peptide_output - protein_output, p=2))
|
25 |
+
```
|
26 |
+
|
27 |
+
Model checkpint: `peptriever_2023-06-23T16:07:24.508460`
|