Update README.md
Browse files
README.md
CHANGED
@@ -30,7 +30,7 @@ This model is initialized with BERTweet and trained with an MLM objective.
|
|
30 |
This pre-trained language model **can be fine-tunned to any downstream task (e.g. classification)**.
|
31 |
|
32 |
```python
|
33 |
-
from transformers import
|
34 |
import torch
|
35 |
|
36 |
# choose GPU if available
|
@@ -40,8 +40,8 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
40 |
pretrained_LM_path = "kornosk/polibertweet-mlm"
|
41 |
|
42 |
# load model
|
43 |
-
tokenizer =
|
44 |
-
model =
|
45 |
|
46 |
# fill mask
|
47 |
example = "Trump is the <mask> of USA"
|
|
|
30 |
This pre-trained language model **can be fine-tunned to any downstream task (e.g. classification)**.
|
31 |
|
32 |
```python
|
33 |
+
from transformers import AutoModel, AutoTokenizer, pipeline
|
34 |
import torch
|
35 |
|
36 |
# choose GPU if available
|
|
|
40 |
pretrained_LM_path = "kornosk/polibertweet-mlm"
|
41 |
|
42 |
# load model
|
43 |
+
tokenizer = AutoTokenizer.from_pretrained(pretrained_LM_path)
|
44 |
+
model = AutoModel.from_pretrained(pretrained_LM_path)
|
45 |
|
46 |
# fill mask
|
47 |
example = "Trump is the <mask> of USA"
|