Update README.md
Browse files
README.md
CHANGED
|
@@ -6,9 +6,12 @@ I do not own, distribute, or take credits for this model, all copyrights belong
|
|
| 6 |
|
| 7 |
|
| 8 |
# how to load the model
|
| 9 |
-
|
|
|
|
| 10 |
!git clone https://huggingface.co/not-lain/TunBERT
|
| 11 |
-
|
|
|
|
|
|
|
| 12 |
import torch.nn as nn
|
| 13 |
import torch
|
| 14 |
from transformers import AutoTokenizer, AutoModelForMaskedLM, AutoModelForSequenceClassification, PreTrainedModel,AutoConfig, BertModel
|
|
@@ -44,7 +47,7 @@ class TunBERT(PreTrainedModel):
|
|
| 44 |
|
| 45 |
|
| 46 |
tunbert = TunBERT(config)
|
| 47 |
-
tunbert.load_state_dict(torch.load("
|
| 48 |
|
| 49 |
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
|
| 50 |
```
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
# how to load the model
|
| 9 |
+
download the weights
|
| 10 |
+
```
|
| 11 |
!git clone https://huggingface.co/not-lain/TunBERT
|
| 12 |
+
```
|
| 13 |
+
load the model
|
| 14 |
+
```python
|
| 15 |
import torch.nn as nn
|
| 16 |
import torch
|
| 17 |
from transformers import AutoTokenizer, AutoModelForMaskedLM, AutoModelForSequenceClassification, PreTrainedModel,AutoConfig, BertModel
|
|
|
|
| 47 |
|
| 48 |
|
| 49 |
tunbert = TunBERT(config)
|
| 50 |
+
tunbert.load_state_dict(torch.load("TunBERT/pytorch_model.bin"))
|
| 51 |
|
| 52 |
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
|
| 53 |
```
|