Bo1015 commited on
Commit
5d5f236
·
verified ·
1 Parent(s): 73fa48a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -4
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
- config = AutoConfig.from_pretrained("biomap-research/xtrimopglm-3b-mlm", trust_remote_code=True, torch_dtype=torch.bfloat16)
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.from_config(config, trust_remote_code=True, torch_dtype=torch.bfloat16)
52
 
53
  # model for the token-level tasks
54
- model = AutoModelForTokenClassification.from_config(config, trust_remote_code=True, torch_dtype=torch.bfloat16)
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