File size: 1,085 Bytes
9cf2a8a
 
 
 
 
 
deff72c
 
 
 
 
 
9cf2a8a
 
deff72c
 
 
9cf2a8a
deff72c
9cf2a8a
 
 
 
 
 
 
 
 
 
 
 
 
 
deff72c
9cf2a8a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
language: en
license: mit
datasets:
- ronig/protein_binding_sequences
---
## Peptriever BiEncoder for Protein-Peptide Binding
The model and training process is outlined in [this application note](). Training code can be found [here](https://github.com/RoniGurvich/Peptriever). 

For more details see the [application page](https://peptriever.app) 

## Usage

```python
import torch
from transformers import AutoModel, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("ronig/protein_biencoder")
model = AutoModel.from_pretrained("ronig/protein_biencoder", trust_remote_code=True)
model.eval()

peptide_sequence = "AAA"
protein_sequence = "MMM"
encoded_peptide = tokenizer.encode_plus(peptide_sequence, return_tensors='pt')
encoded_protein = tokenizer.encode_plus(protein_sequence, return_tensors='pt')

with torch.no_grad():
    peptide_output = model.forward1(encoded_peptide)
    protein_output = model.forward2(encoded_protein)

print("distance: ", torch.norm(peptide_output - protein_output, p=2))
```

## Version
Model checkpint: `peptriever_2023-06-23T16:07:24.508460`