yinuozhang
commited on
Commit
•
c860158
1
Parent(s):
b84fc7f
fixed bug
Browse files- README.md +4 -1
- config.json +1 -1
README.md
CHANGED
@@ -25,12 +25,15 @@ You can try out the MetaLATTE model directly in your browser:
|
|
25 |
|
26 |
```python
|
27 |
from transformers import AutoTokenizer, AutoModel, AutoConfig
|
|
|
|
|
|
|
28 |
|
29 |
tokenizer = AutoTokenizer.from_pretrained("facebook/esm2_t33_650M_UR50D")
|
30 |
config = AutoConfig.from_pretrained("ChatterjeeLab/MetaLATTE")
|
31 |
model = AutoModel.from_pretrained("ChatterjeeLab/MetaLATTE", config=config)
|
32 |
|
33 |
-
|
34 |
sequence = "AVYNIGWSFNVNGARGKSFRAGDVLVFKYIKGQHNVVAVNGRGYASCSAPRGARTYSSGQDRIKLTRGQNYFICSFPGHCGGGMKIAINAK"
|
35 |
inputs = tokenizer(sequence, return_tensors="pt")
|
36 |
raw_probs, predictions = model(**inputs)
|
|
|
25 |
|
26 |
```python
|
27 |
from transformers import AutoTokenizer, AutoModel, AutoConfig
|
28 |
+
from metalatte import MetaLATTEConfig, MetaLATTEModel
|
29 |
+
AutoConfig.register("metalatte", MetaLATTEConfig)
|
30 |
+
AutoModel.register(MetaLATTEConfig, MetaLATTEModel)
|
31 |
|
32 |
tokenizer = AutoTokenizer.from_pretrained("facebook/esm2_t33_650M_UR50D")
|
33 |
config = AutoConfig.from_pretrained("ChatterjeeLab/MetaLATTE")
|
34 |
model = AutoModel.from_pretrained("ChatterjeeLab/MetaLATTE", config=config)
|
35 |
|
36 |
+
model.eval()
|
37 |
sequence = "AVYNIGWSFNVNGARGKSFRAGDVLVFKYIKGQHNVVAVNGRGYASCSAPRGARTYSSGQDRIKLTRGQNYFICSFPGHCGGGMKIAINAK"
|
38 |
inputs = tokenizer(sequence, return_tensors="pt")
|
39 |
raw_probs, predictions = model(**inputs)
|
config.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
"architectures": [
|
3 |
"MultitaskProteinModel"
|
4 |
],
|
5 |
-
"model_type": "
|
6 |
"num_labels": 15,
|
7 |
"hidden_size": 1280,
|
8 |
"num_hidden_layers": 33,
|
|
|
2 |
"architectures": [
|
3 |
"MultitaskProteinModel"
|
4 |
],
|
5 |
+
"model_type": "metalatte",
|
6 |
"num_labels": 15,
|
7 |
"hidden_size": 1280,
|
8 |
"num_hidden_layers": 33,
|