rightyonghu
commited on
Commit
•
8ad1231
1
Parent(s):
1fb5566
update ernie3.0 model
Browse files- README.md +2 -8
- config.json +2 -3
- pytorch_model.bin +2 -2
README.md
CHANGED
@@ -18,18 +18,12 @@ a series of experiments have been conducted to check the accuracy of the convers
|
|
18 |
- Pytorch Conversion repo: https://github.com/nghuyong/ERNIE-Pytorch
|
19 |
|
20 |
## How to use
|
21 |
-
If you want to use ernie-3.0 series models, you need to add `task_type_id` to BERT model following this [MR](https://github.com/huggingface/transformers/pull/18686/files)
|
22 |
-
**OR** you can re-install the transformers from my changed branch.
|
23 |
-
```bash
|
24 |
-
pip uninstall transformers # optional
|
25 |
-
pip install git+https://github.com/nghuyong/transformers@add_task_type_id # reinstall
|
26 |
-
```
|
27 |
Then you can load ERNIE-3.0 model as before:
|
28 |
```Python
|
29 |
-
from transformers import BertTokenizer,
|
30 |
|
31 |
tokenizer = BertTokenizer.from_pretrained("nghuyong/ernie-3.0-base-zh")
|
32 |
-
model =
|
33 |
```
|
34 |
|
35 |
## Citation
|
|
|
18 |
- Pytorch Conversion repo: https://github.com/nghuyong/ERNIE-Pytorch
|
19 |
|
20 |
## How to use
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
Then you can load ERNIE-3.0 model as before:
|
22 |
```Python
|
23 |
+
from transformers import BertTokenizer, ErnieForMaskedLM
|
24 |
|
25 |
tokenizer = BertTokenizer.from_pretrained("nghuyong/ernie-3.0-base-zh")
|
26 |
+
model = ErnieForMaskedLM.from_pretrained("nghuyong/ernie-3.0-base-zh")
|
27 |
```
|
28 |
|
29 |
## Citation
|
config.json
CHANGED
@@ -11,11 +11,10 @@
|
|
11 |
"type_vocab_size": 4,
|
12 |
"use_task_id": true,
|
13 |
"vocab_size": 40000,
|
14 |
-
"init_class": "ErnieModel",
|
15 |
"layer_norm_eps": 1e-05,
|
16 |
-
"model_type": "
|
17 |
"architectures": [
|
18 |
-
"
|
19 |
],
|
20 |
"intermediate_size": 3072
|
21 |
}
|
|
|
11 |
"type_vocab_size": 4,
|
12 |
"use_task_id": true,
|
13 |
"vocab_size": 40000,
|
|
|
14 |
"layer_norm_eps": 1e-05,
|
15 |
+
"model_type": "ernie",
|
16 |
"architectures": [
|
17 |
+
"ErnieForMaskedLM"
|
18 |
],
|
19 |
"intermediate_size": 3072
|
20 |
}
|
pytorch_model.bin
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:70f4eead24a3263534ec6e70d692a52a1e5fbd199f154076532e6fdcf536cbfd
|
3 |
+
size 474373095
|