kornosk commited on
Commit
5cb0a20
1 Parent(s): c5bd4d3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
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 BertTokenizer, BertForMaskedLM, pipeline
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 = BertTokenizer.from_pretrained(pretrained_LM_path)
44
- model = BertForMaskedLM.from_pretrained(pretrained_LM_path)
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"