Commit
·
3baa823
1
Parent(s):
e25c9fb
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,10 +12,12 @@ To use this model, use the following [paf_modeling_roberta.py](https://github.co
|
|
| 12 |
## Here is how to use this model to get the features of a given text in PyTorch
|
| 13 |
|
| 14 |
```python
|
| 15 |
-
|
| 16 |
from paf_modeling_roberta import RobertaModel
|
| 17 |
-
|
|
|
|
| 18 |
model = RobertaModel.from_pretrained('luffycodes/parallel-roberta-large')
|
|
|
|
| 19 |
text = "Replace me by any text you'd like."
|
| 20 |
encoded_input = tokenizer(text, return_tensors='pt')
|
| 21 |
output = model(**encoded_input)
|
|
|
|
| 12 |
## Here is how to use this model to get the features of a given text in PyTorch
|
| 13 |
|
| 14 |
```python
|
| 15 |
+
# use paf_modeling_roberta.py instead of modeling_roberta
|
| 16 |
from paf_modeling_roberta import RobertaModel
|
| 17 |
+
from transformers import RobertaTokenizer
|
| 18 |
+
|
| 19 |
model = RobertaModel.from_pretrained('luffycodes/parallel-roberta-large')
|
| 20 |
+
tokenizer = RobertaTokenizer.from_pretrained('roberta-large')
|
| 21 |
text = "Replace me by any text you'd like."
|
| 22 |
encoded_input = tokenizer(text, return_tensors='pt')
|
| 23 |
output = model(**encoded_input)
|