Commit
·
ec62a6f
1
Parent(s):
9c1295f
Update README.md
Browse files
README.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
| 2 |
|
| 3 |
Official Repository Link: https://github.com/alibaba/AliceMind/tree/main/StructBERT
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
[https://arxiv.org/abs/1908.04577](https://arxiv.org/abs/1908.04577)
|
| 6 |
|
| 7 |
## Introduction
|
|
|
|
| 2 |
|
| 3 |
Official Repository Link: https://github.com/alibaba/AliceMind/tree/main/StructBERT
|
| 4 |
|
| 5 |
+
## Reproduce HFHub models:
|
| 6 |
+
```python
|
| 7 |
+
!cp en_model pytorch_model.bin
|
| 8 |
+
!cp large_bert_config.json config.json
|
| 9 |
+
|
| 10 |
+
from transformers import AutoConfig, AutoModelForMaskedLM, AutoTokenizer
|
| 11 |
+
|
| 12 |
+
config = AutoConfig.from_pretrained("./large_bert_config.json")
|
| 13 |
+
model = AutoModelForMaskedLM.from_pretrained("./", config=config)
|
| 14 |
+
tokenizer = AutoTokenizer.from_pretrained(".", config=config)
|
| 15 |
+
|
| 16 |
+
model.push_to_hub("structbert-large")
|
| 17 |
+
tokenizer.push_to_hub("structbert-large")
|
| 18 |
+
```
|
| 19 |
+
|
| 20 |
[https://arxiv.org/abs/1908.04577](https://arxiv.org/abs/1908.04577)
|
| 21 |
|
| 22 |
## Introduction
|