Update README.md
Browse files
README.md
CHANGED
|
@@ -11,7 +11,7 @@ language:
|
|
| 11 |
- en
|
| 12 |
---
|
| 13 |
|
| 14 |
-
#
|
| 15 |
|
| 16 |
A minimal Hugging Face-compatible PyTorch model for peptide presentation using ESM with optional LoRA and cross-attention.
|
| 17 |
There is no custom predict API; inference follows the training path: tokenize peptide and HLA pseudosequence with the ESM tokenizer, pad or truncate to fixed lengths (default peptide=16, HLA=36), run a forward pass as `logits, features = model(epitope_ids, hla_ids)`, then apply softmax to get the binding probability.
|
|
@@ -33,11 +33,11 @@ pip install torch transformers peft
|
|
| 33 |
import torch
|
| 34 |
import torch.nn.functional as F
|
| 35 |
from transformers import AutoModel, AutoTokenizer
|
| 36 |
-
model_id = "SkywalkerLu/
|
| 37 |
model = AutoModel.from_pretrained(model_id, trust_remote_code=True).to(device).eval()
|
| 38 |
```
|
| 39 |
```
|
| 40 |
-
## How to use
|
| 41 |
```python
|
| 42 |
import torch
|
| 43 |
import torch.nn.functional as F
|
|
@@ -46,7 +46,7 @@ from transformers import AutoModel, AutoTokenizer
|
|
| 46 |
# Device
|
| 47 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 48 |
|
| 49 |
-
model_id = "SkywalkerLu/
|
| 50 |
model = AutoModel.from_pretrained(model_id, trust_remote_code=True).to(device).eval()
|
| 51 |
|
| 52 |
# Load tokenizer used in training (ESM2 650M)
|
|
@@ -80,7 +80,7 @@ from transformers import AutoModel, AutoTokenizer
|
|
| 80 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 81 |
|
| 82 |
# 加载 PRE 模型(注意:确保该模型确实支持 logits 输出)
|
| 83 |
-
model_id = "SkywalkerLu/
|
| 84 |
model = AutoModel.from_pretrained(model_id, trust_remote_code=True).to(device).eval()
|
| 85 |
|
| 86 |
# 加载与训练一致的 ESM2 tokenizer
|
|
|
|
| 11 |
- en
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# TriStageHLA-PRE
|
| 15 |
|
| 16 |
A minimal Hugging Face-compatible PyTorch model for peptide presentation using ESM with optional LoRA and cross-attention.
|
| 17 |
There is no custom predict API; inference follows the training path: tokenize peptide and HLA pseudosequence with the ESM tokenizer, pad or truncate to fixed lengths (default peptide=16, HLA=36), run a forward pass as `logits, features = model(epitope_ids, hla_ids)`, then apply softmax to get the binding probability.
|
|
|
|
| 33 |
import torch
|
| 34 |
import torch.nn.functional as F
|
| 35 |
from transformers import AutoModel, AutoTokenizer
|
| 36 |
+
model_id = "SkywalkerLu/TriStageHLA-PRE"
|
| 37 |
model = AutoModel.from_pretrained(model_id, trust_remote_code=True).to(device).eval()
|
| 38 |
```
|
| 39 |
```
|
| 40 |
+
## How to use TriStageHLA-PRE
|
| 41 |
```python
|
| 42 |
import torch
|
| 43 |
import torch.nn.functional as F
|
|
|
|
| 46 |
# Device
|
| 47 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 48 |
|
| 49 |
+
model_id = "SkywalkerLu/TriStageHLA-PRE"
|
| 50 |
model = AutoModel.from_pretrained(model_id, trust_remote_code=True).to(device).eval()
|
| 51 |
|
| 52 |
# Load tokenizer used in training (ESM2 650M)
|
|
|
|
| 80 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 81 |
|
| 82 |
# 加载 PRE 模型(注意:确保该模型确实支持 logits 输出)
|
| 83 |
+
model_id = "SkywalkerLu/TriStageHLA-PRE"
|
| 84 |
model = AutoModel.from_pretrained(model_id, trust_remote_code=True).to(device).eval()
|
| 85 |
|
| 86 |
# 加载与训练一致的 ESM2 tokenizer
|