ideasbyjin
commited on
Commit
·
c89e60b
1
Parent(s):
805aa0c
Update
Browse files
README.md
CHANGED
@@ -22,20 +22,17 @@ non-commercial use. For any users seeking commercial use of our model and genera
|
|
22 |
|
23 |
```
|
24 |
>>> from transformers import (
|
25 |
-
|
26 |
RoFormerTokenizer,
|
27 |
-
pipeline,
|
28 |
RoFormerForSequenceClassification
|
29 |
)
|
30 |
>>> tokenizer = RoFormerTokenizer.from_pretrained("alchemab/antiberta2")
|
31 |
-
>>> model =
|
32 |
-
|
33 |
-
>>> filler = pipeline(model=model, tokenizer=tokenizer)
|
34 |
-
>>> filler("Ḣ Q V Q ... C A [MASK] D ... T V S S") # fill in the mask
|
35 |
|
36 |
>>> new_model = RoFormerForSequenceClassification.from_pretrained(
|
37 |
-
"alchemab/antiberta2") # this will of course raise warnings
|
38 |
-
|
39 |
-
|
40 |
|
41 |
```
|
|
|
22 |
|
23 |
```
|
24 |
>>> from transformers import (
|
25 |
+
RoFormerModel,
|
26 |
RoFormerTokenizer,
|
|
|
27 |
RoFormerForSequenceClassification
|
28 |
)
|
29 |
>>> tokenizer = RoFormerTokenizer.from_pretrained("alchemab/antiberta2")
|
30 |
+
>>> model = RoFormerModel.from_pretrained("alchemab/antiberta2")
|
31 |
+
>>> model(**tokenizer("Ḣ Q V Q ... T V S S", return_tensors='pt')).last_hidden_state... # etc
|
|
|
|
|
32 |
|
33 |
>>> new_model = RoFormerForSequenceClassification.from_pretrained(
|
34 |
+
"alchemab/antiberta2-cssp") # this will of course raise warnings
|
35 |
+
# that a new linear layer will be added
|
36 |
+
# and randomly initialized
|
37 |
|
38 |
```
|