Update README.md
Browse files
README.md
CHANGED
|
@@ -28,7 +28,7 @@ Sequences were:
|
|
| 28 |
|
| 29 |
### Loading the Model
|
| 30 |
|
| 31 |
-
|
| 32 |
from transformers import EsmModel, AutoTokenizer
|
| 33 |
import torch
|
| 34 |
|
|
@@ -36,11 +36,11 @@ import torch
|
|
| 36 |
model = EsmModel.from_pretrained("MahTala/AbCDR-ESM2")
|
| 37 |
tokenizer = AutoTokenizer.from_pretrained("MahTala/AbCDR-ESM2")
|
| 38 |
model.eval()
|
| 39 |
-
|
| 40 |
|
| 41 |
### Extract Embeddings
|
| 42 |
|
| 43 |
-
|
| 44 |
# Prepare paired sequence
|
| 45 |
SEP_TOKEN = "-"
|
| 46 |
heavy_chain = (
|
|
@@ -66,7 +66,7 @@ mask = inputs["attention_mask"].unsqueeze(-1)
|
|
| 66 |
pooled = (embeddings * mask).sum(1) / mask.sum(1)
|
| 67 |
|
| 68 |
print(f"Embedding shape: {pooled.shape}") # (1, 2560)
|
| 69 |
-
|
| 70 |
|
| 71 |
## Input Format
|
| 72 |
|
|
@@ -78,9 +78,9 @@ print(f"Embedding shape: {pooled.shape}") # (1, 2560)
|
|
| 78 |
- Uncommon residues should be replaced with X
|
| 79 |
|
| 80 |
**Example:**
|
| 81 |
-
|
| 82 |
sequence = "EVQLVESGGGLVQPGGSLRLSCAASGFTFSSYAMS...-DIQMTQSPSSLSASVGDRVTITCRASQSISS..."
|
| 83 |
-
|
| 84 |
|
| 85 |
## Output
|
| 86 |
|
|
|
|
| 28 |
|
| 29 |
### Loading the Model
|
| 30 |
|
| 31 |
+
```python
|
| 32 |
from transformers import EsmModel, AutoTokenizer
|
| 33 |
import torch
|
| 34 |
|
|
|
|
| 36 |
model = EsmModel.from_pretrained("MahTala/AbCDR-ESM2")
|
| 37 |
tokenizer = AutoTokenizer.from_pretrained("MahTala/AbCDR-ESM2")
|
| 38 |
model.eval()
|
| 39 |
+
```
|
| 40 |
|
| 41 |
### Extract Embeddings
|
| 42 |
|
| 43 |
+
```python
|
| 44 |
# Prepare paired sequence
|
| 45 |
SEP_TOKEN = "-"
|
| 46 |
heavy_chain = (
|
|
|
|
| 66 |
pooled = (embeddings * mask).sum(1) / mask.sum(1)
|
| 67 |
|
| 68 |
print(f"Embedding shape: {pooled.shape}") # (1, 2560)
|
| 69 |
+
```
|
| 70 |
|
| 71 |
## Input Format
|
| 72 |
|
|
|
|
| 78 |
- Uncommon residues should be replaced with X
|
| 79 |
|
| 80 |
**Example:**
|
| 81 |
+
```python
|
| 82 |
sequence = "EVQLVESGGGLVQPGGSLRLSCAASGFTFSSYAMS...-DIQMTQSPSSLSASVGDRVTITCRASQSISS..."
|
| 83 |
+
```
|
| 84 |
|
| 85 |
## Output
|
| 86 |
|