Update README.md
Browse files
README.md
CHANGED
@@ -32,8 +32,7 @@ from transformers import AutoModelForMaskedLM, AutoModelForSequenceClassificatio
|
|
32 |
import torch
|
33 |
|
34 |
tokenizer = AutoTokenizer.from_pretrained("biomap-research/xtrimopglm-1b-mlm", trust_remote_code=True, use_fast=True)
|
35 |
-
|
36 |
-
model = AutoModelForMaskedLM.from_config(config, trust_remote_code=True, torch_dtype=torch.bfloat16)
|
37 |
if torch.cuda.is_available():
|
38 |
model = model.cuda()
|
39 |
model.eval()
|
@@ -46,10 +45,10 @@ with torch.inference_mode():
|
|
46 |
|
47 |
|
48 |
# model for the sequence-level tasks
|
49 |
-
model = AutoModelForSequenceClassification.
|
50 |
|
51 |
# model for the token-level tasks
|
52 |
-
model = AutoModelForTokenClassification.
|
53 |
|
54 |
```
|
55 |
|
|
|
32 |
import torch
|
33 |
|
34 |
tokenizer = AutoTokenizer.from_pretrained("biomap-research/xtrimopglm-1b-mlm", trust_remote_code=True, use_fast=True)
|
35 |
+
model = AutoModelForMaskedLM.from_pretrained("biomap-research/xtrimopglm-1b-mlm", trust_remote_code=True, torch_dtype=torch.bfloat16)
|
|
|
36 |
if torch.cuda.is_available():
|
37 |
model = model.cuda()
|
38 |
model.eval()
|
|
|
45 |
|
46 |
|
47 |
# model for the sequence-level tasks
|
48 |
+
model = AutoModelForSequenceClassification.from_pretrained("biomap-research/xtrimopglm-1b-mlm", trust_remote_code=True, torch_dtype=torch.bfloat16)
|
49 |
|
50 |
# model for the token-level tasks
|
51 |
+
model = AutoModelForTokenClassification.from_pretrained("biomap-research/xtrimopglm-1b-mlm", trust_remote_code=True, torch_dtype=torch.bfloat16)
|
52 |
|
53 |
```
|
54 |
|