Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,48 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
license: apache-2.0
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- zh
|
4 |
+
|
5 |
+
inference:
|
6 |
+
parameters:
|
7 |
+
max_new_tokens: 128
|
8 |
+
repetition_penalty: 25.0
|
9 |
+
top_p: 0.9
|
10 |
+
do_sample: True
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
license: apache-2.0
|
15 |
---
|
16 |
+
# Wenzhong-GPT2-110M model (chinese),one model of [Fengshenbang-LM](https://github.com/IDEA-CCNL/Fengshenbang-LM).
|
17 |
+
Wenzhong-GPT2-110M is one of the Wenzhong series, which has smaller parameters. Wenzhong-GPT2-110M Is the base version of gpt2。
|
18 |
+
|
19 |
+
## Usage
|
20 |
+
|
21 |
+
### load model
|
22 |
+
```python
|
23 |
+
from transformers import GPT2Tokenizer, GPT2Model
|
24 |
+
tokenizer = GPT2Tokenizer.from_pretrained('IDEA-CCNL/Wenzhong-GPT2-3.5B')
|
25 |
+
model = GPT2Model.from_pretrained('IDEA-CCNL/Wenzhong-GPT2-3.5B')
|
26 |
+
text = "Replace me by any text you'd like."
|
27 |
+
encoded_input = tokenizer(text, return_tensors='pt')
|
28 |
+
output = model(**encoded_input)
|
29 |
+
```
|
30 |
+
### generation
|
31 |
+
```python
|
32 |
+
from transformers import pipeline, set_seed
|
33 |
+
set_seed(55)
|
34 |
+
generator = pipeline('text-generation', model='IDEA-CCNL/Wenzhong-GPT2-3.5B')
|
35 |
+
generator("北京位于", max_length=30, num_return_sequences=1)
|
36 |
+
|
37 |
+
```
|
38 |
+
|
39 |
+
## Citation
|
40 |
+
If you find the resource is useful, please cite the following website in your paper.
|
41 |
+
```
|
42 |
+
@misc{Fengshenbang-LM,
|
43 |
+
title={Fengshenbang-LM},
|
44 |
+
author={IDEA-CCNL},
|
45 |
+
year={2021},
|
46 |
+
howpublished={\url{https://github.com/IDEA-CCNL/Fengshenbang-LM}},
|
47 |
+
}
|
48 |
+
```
|