Update README.md
#5
by
Alex0007
- opened
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,
|
46 |
tokenizer = GPT2Tokenizer.from_pretrained('IDEA-CCNL/Wenzhong2.0-GPT2-3.5B-chinese')
|
47 |
-
model =
|
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)
|