Views
No views yet
1# use paf_modeling_roberta.py instead of modeling_roberta
2from paf_modeling_roberta import RobertaModel
3from transformers import RobertaTokenizer
4
5model = RobertaModel.from_pretrained('luffycodes/parallel-roberta-large')
6tokenizer = RobertaTokenizer.from_pretrained('roberta-large')
7text = "Replace me by any text you'd like."
8encoded_input = tokenizer(text, return_tensors='pt')
9output = model(**encoded_input)self.kqv_ffn1.weight.data = torch.cat((attention.self.key.weight.data, attention.self.query.weight.data,
attention.self.value.weight.data,
intermediate.dense.weight.data))| Task | MNLI | QQP | QNLI | SST-2 | CoLA | STS-B | MRPC | RTE |
|---|---|---|---|---|---|---|---|---|
| 89.3 | 91.7 | 94.3 | 96.2 | 64.0 | 91.0 | 90.4 | 80.1 |
@misc{sonkar2023investigating,
title={Investigating the Role of Feed-Forward Networks in Transformers Using Parallel Attention and Feed-Forward Net Design},
author={Shashank Sonkar and Richard G. Baraniuk},
year={2023},
eprint={2305.13297},
archivePrefix={arXiv},
primaryClass={cs.CL}
}