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