Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -42,9 +42,9 @@ To obtain a powerful unidirectional language model, we adopt the GPT model struc
42
  ### 加载模型 Loading Models
43
 
44
  ```python
45
- from transformers import GPT2Tokenizer, GPT2Model
46
  tokenizer = GPT2Tokenizer.from_pretrained('IDEA-CCNL/Wenzhong2.0-GPT2-3.5B-chinese')
47
- model = GPT2Model.from_pretrained('IDEA-CCNL/Wenzhong2.0-GPT2-3.5B-chinese')
48
  text = "Replace me by any text you'd like."
49
  encoded_input = tokenizer(text, return_tensors='pt')
50
  output = model(**encoded_input)
 
42
  ### 加载模型 Loading Models
43
 
44
  ```python
45
+ from transformers import GPT2Tokenizer, GPT2LMHeadModel
46
  tokenizer = GPT2Tokenizer.from_pretrained('IDEA-CCNL/Wenzhong2.0-GPT2-3.5B-chinese')
47
+ model = GPT2LMHeadModel.from_pretrained('IDEA-CCNL/Wenzhong2.0-GPT2-3.5B-chinese')
48
  text = "Replace me by any text you'd like."
49
  encoded_input = tokenizer(text, return_tensors='pt')
50
  output = model(**encoded_input)