File size: 1,517 Bytes
19d6f53
 
 
bf23e44
 
 
3c33be7
976ad7b
 
 
3d994c0
bf23e44
 
19d6f53
 
d1bf718
 
19d6f53
 
6a0aad9
 
 
 
d1bf718
 
6a0aad9
 
 
 
 
19d6f53
 
 
d1bf718
19d6f53
 
 
 
 
 
 
d5c654e
 
 
 
 
 
19d6f53
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
language: 
  - zh

inference:
  parameters:
    max_new_tokens: 128
    repetition_penalty: 25
    top_p: 0.9
    do_sample: True
    
    

license: apache-2.0
---
# Wenzhong-GPT2-3.5B model (chinese),one model of [Fengshenbang-LM](https://github.com/IDEA-CCNL/Fengshenbang-LM).
As we all know, the single direction language model based on decoder structure has strong generation ability, such as GPT model. **The 3.5 billion parameter Wenzhong-GPT2-3.5B large model, using 100G chinese common data, 32 A100 training for 28 hours,** is the largest open source **GPT2 large model of chinese**. **Our model performs well in Chinese continuation generation.**

## Usage

### load model
```python 
from transformers import GPT2Tokenizer, GPT2Model
tokenizer = GPT2Tokenizer.from_pretrained('IDEA-CCNL/Wenzhong-GPT2-3.5B')
model = GPT2Model.from_pretrained('IDEA-CCNL/Wenzhong-GPT2-3.5B')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
```
### generation
```python
from transformers import pipeline, set_seed
set_seed(55)
generator = pipeline('text-generation', model='IDEA-CCNL/Wenzhong-GPT2-3.5B')
generator("北京位于", max_length=30, num_return_sequences=1)

```

## Citation
If you find the resource is useful, please cite the following website in your paper.
```
@misc{Fengshenbang-LM,
  title={Fengshenbang-LM},
  author={IDEA-CCNL},
  year={2021},
  howpublished={\url{https://github.com/IDEA-CCNL/Fengshenbang-LM}},
}
```