Update README.md
Browse files
README.md
CHANGED
|
@@ -13,15 +13,26 @@ Here's how to extract PepDoRA embeddings for your input peptide:
|
|
| 13 |
|
| 14 |
```
|
| 15 |
import torch
|
| 16 |
-
from transformers import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
# Load the model and tokenizer
|
| 19 |
model_name = "ChatterjeeLab/PepDoRA"
|
|
|
|
|
|
|
| 20 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 21 |
-
model = AutoModel.from_pretrained(model_name
|
| 22 |
-
|
| 23 |
|
| 24 |
-
# Input peptide sequence
|
| 25 |
peptide = "CC(C)C[C@H]1NC(=O)[C@@H](C)NCCCCCCNC(=O)[C@H](CO)NC1=O"
|
| 26 |
|
| 27 |
# Tokenize the peptide
|
|
|
|
| 13 |
|
| 14 |
```
|
| 15 |
import torch
|
| 16 |
+
from transformers import AutoModel,AutoModelForCausalLM, AutoTokenizer
|
| 17 |
+
from peft import PeftModel, PeftConfig
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
# Merge the adapter with the base model
|
| 21 |
+
base_model = "DeepChem/ChemBERTa-77M-MLM"
|
| 22 |
+
adapter_model = "ChatterjeeLab/PepDoRA"
|
| 23 |
+
model = AutoModelForCausalLM.from_pretrained(base_model)
|
| 24 |
+
model = PeftModel.from_pretrained(model, adapter_model)
|
| 25 |
+
tokenizer = AutoTokenizer.from_pretrained(base_model)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
from transformers import AutoModel
|
| 29 |
|
|
|
|
| 30 |
model_name = "ChatterjeeLab/PepDoRA"
|
| 31 |
+
|
| 32 |
+
# Load the model and the tokenizer using AutoModel
|
| 33 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 34 |
+
model = AutoModel.from_pretrained(model_name)
|
|
|
|
| 35 |
|
|
|
|
| 36 |
peptide = "CC(C)C[C@H]1NC(=O)[C@@H](C)NCCCCCCNC(=O)[C@H](CO)NC1=O"
|
| 37 |
|
| 38 |
# Tokenize the peptide
|