luffycodes
commited on
Commit
•
8fa24cb
1
Parent(s):
312454f
Update README.md
Browse files
README.md
CHANGED
@@ -7,7 +7,19 @@ language:
|
|
7 |
|
8 |
We provide the [weights](https://huggingface.co/luffycodes/Parallel-Roberta-Large) for the parallel attention and feedforward design for Roberta-Large.
|
9 |
|
10 |
-
To use this model, use the following [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
![pfa (1)](https://github.com/luffycodes/Parallel-Transformers-Pytorch/assets/22951144/e5b76b1c-5fb1-4263-a23b-a61742fe12ae)
|
13 |
|
|
|
7 |
|
8 |
We provide the [weights](https://huggingface.co/luffycodes/Parallel-Roberta-Large) for the parallel attention and feedforward design for Roberta-Large.
|
9 |
|
10 |
+
To use this model, use the following [paf_modeling_roberta.py](https://github.com/luffycodes/Parallel-Transformers-Pytorch/blob/main/paf_modeling_roberta.py) file.
|
11 |
+
|
12 |
+
Here is how to use this model to get the features of a given text in PyTorch:
|
13 |
+
|
14 |
+
```python
|
15 |
+
from transformers import RobertaTokenizer
|
16 |
+
from paf_modeling_roberta import RobertaModel
|
17 |
+
tokenizer = RobertaTokenizer.from_pretrained('roberta-large')
|
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)
|
22 |
+
```
|
23 |
|
24 |
![pfa (1)](https://github.com/luffycodes/Parallel-Transformers-Pytorch/assets/22951144/e5b76b1c-5fb1-4263-a23b-a61742fe12ae)
|
25 |
|