Update README.md
Browse files
README.md
CHANGED
|
@@ -30,8 +30,8 @@ We evaluated the ProteinPGLM-MLM (PGLM) and ProteinPGLM-INT4(100B) models on two
|
|
| 30 |
from transformers import AutoModelForMaskedLM, AutoModelForSequenceClassification, AutoModelForTokenClassification, AutoTokenizer, AutoConfig
|
| 31 |
import torch
|
| 32 |
|
| 33 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
| 34 |
-
model = AutoModelForMaskedLM.from_pretrained("
|
| 35 |
if torch.cuda.is_available():
|
| 36 |
model = model.cuda()
|
| 37 |
model.eval()
|
|
@@ -44,10 +44,10 @@ with torch.inference_mode():
|
|
| 44 |
|
| 45 |
|
| 46 |
# model for the sequence-level tasks
|
| 47 |
-
model = AutoModelForSequenceClassification.from_pretrained("
|
| 48 |
|
| 49 |
# model for the token-level tasks
|
| 50 |
-
model = AutoModelForTokenClassification.from_pretrained("
|
| 51 |
|
| 52 |
```
|
| 53 |
|
|
|
|
| 30 |
from transformers import AutoModelForMaskedLM, AutoModelForSequenceClassification, AutoModelForTokenClassification, AutoTokenizer, AutoConfig
|
| 31 |
import torch
|
| 32 |
|
| 33 |
+
tokenizer = AutoTokenizer.from_pretrained("proteinglm/proteinglm-1b-mlm", trust_remote_code=True, use_fast=True)
|
| 34 |
+
model = AutoModelForMaskedLM.from_pretrained("proteinglm/proteinglm-1b-mlm", trust_remote_code=True, torch_dtype=torch.bfloat16)
|
| 35 |
if torch.cuda.is_available():
|
| 36 |
model = model.cuda()
|
| 37 |
model.eval()
|
|
|
|
| 44 |
|
| 45 |
|
| 46 |
# model for the sequence-level tasks
|
| 47 |
+
model = AutoModelForSequenceClassification.from_pretrained("proteinglm/proteinglm-10b-mlm", trust_remote_code=True, torch_dtype=torch.bfloat16)
|
| 48 |
|
| 49 |
# model for the token-level tasks
|
| 50 |
+
model = AutoModelForTokenClassification.from_pretrained("proteinglm/proteinglm-10b-mlm", trust_remote_code=True, torch_dtype=torch.bfloat16)
|
| 51 |
|
| 52 |
```
|
| 53 |
|