Bo1015 commited on
Commit
edd4af7
·
verified ·
1 Parent(s): 735d93b

Update README.md

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