Update README.md
Browse files
README.md
CHANGED
@@ -4,8 +4,10 @@ widget:
|
|
4 |
- text: "[CLS] 万 叠 春 山 积 雨 晴 ,"
|
5 |
- text: "[CLS] 大 漠"
|
6 |
|
|
|
7 |
---
|
8 |
|
|
|
9 |
# Chinese Poem GPT2 Model
|
10 |
|
11 |
## Model description
|
@@ -52,7 +54,7 @@ The model is pre-trained by [UER-py](https://github.com/dbiir/UER-py/) on [Tence
|
|
52 |
python3 preprocess.py --corpus_path corpora/poem.txt \
|
53 |
--vocab_path models/poem_zh_vocab.txt \
|
54 |
--dataset_path poem_dataset.pt --processes_num 16 \
|
55 |
-
--seq_length 128 --
|
56 |
```
|
57 |
|
58 |
```
|
@@ -62,15 +64,12 @@ python3 pretrain.py --dataset_path poem_dataset.pt \
|
|
62 |
--output_model_path models/poem_gpt2_model.bin \
|
63 |
--world_size 8 --gpu_ranks 0 1 2 3 4 5 6 7 \
|
64 |
--total_steps 200000 --save_checkpoint_steps 50000 --report_steps 1000 \
|
65 |
-
--learning_rate 5e-4 --batch_size 64
|
66 |
-
--embedding word_pos --remove_embedding_layernorm \
|
67 |
-
--encoder transformer --mask causal --layernorm_positioning pre \
|
68 |
-
--target lm --tie_weights
|
69 |
```
|
70 |
|
71 |
Finally, we convert the pre-trained model into Huggingface's format:
|
72 |
```
|
73 |
-
python3 scripts/convert_gpt2_from_uer_to_huggingface.py --input_model_path
|
74 |
--output_model_path pytorch_model.bin \
|
75 |
--layers_num 12
|
76 |
```
|
|
|
4 |
- text: "[CLS] 万 叠 春 山 积 雨 晴 ,"
|
5 |
- text: "[CLS] 大 漠"
|
6 |
|
7 |
+
|
8 |
---
|
9 |
|
10 |
+
|
11 |
# Chinese Poem GPT2 Model
|
12 |
|
13 |
## Model description
|
|
|
54 |
python3 preprocess.py --corpus_path corpora/poem.txt \
|
55 |
--vocab_path models/poem_zh_vocab.txt \
|
56 |
--dataset_path poem_dataset.pt --processes_num 16 \
|
57 |
+
--seq_length 128 --data_processor lm
|
58 |
```
|
59 |
|
60 |
```
|
|
|
64 |
--output_model_path models/poem_gpt2_model.bin \
|
65 |
--world_size 8 --gpu_ranks 0 1 2 3 4 5 6 7 \
|
66 |
--total_steps 200000 --save_checkpoint_steps 50000 --report_steps 1000 \
|
67 |
+
--learning_rate 5e-4 --batch_size 64
|
|
|
|
|
|
|
68 |
```
|
69 |
|
70 |
Finally, we convert the pre-trained model into Huggingface's format:
|
71 |
```
|
72 |
+
python3 scripts/convert_gpt2_from_uer_to_huggingface.py --input_model_path poem_gpt2_model.bin-200000 \
|
73 |
--output_model_path pytorch_model.bin \
|
74 |
--layers_num 12
|
75 |
```
|