phlippseitz
commited on
Commit
•
b7df2da
1
Parent(s):
9d318f9
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- onnx
|
4 |
+
- question-answering
|
5 |
+
- roberta
|
6 |
+
- adapter-transformers
|
7 |
+
datasets:
|
8 |
+
- newsqa
|
9 |
+
language:
|
10 |
+
- en
|
11 |
+
---
|
12 |
+
|
13 |
+
# ONNX export of Adapter `AdapterHub/roberta-base-pf-newsqa` for roberta-base
|
14 |
+
## Conversion of [AdapterHub/roberta-base-pf-newsqa](https://huggingface.co/AdapterHub/roberta-base-pf-newsqa) for UKP SQuARE
|
15 |
+
|
16 |
+
|
17 |
+
## Usage
|
18 |
+
```python
|
19 |
+
onnx_path = hf_hub_download(repo_id='UKP-SQuARE/roberta-base-pf-newsqa-onnx', filename='model.onnx') # or model_quant.onnx for quantization
|
20 |
+
onnx_model = InferenceSession(onnx_path, providers=['CPUExecutionProvider'])
|
21 |
+
|
22 |
+
context = 'ONNX is an open format to represent models. The benefits of using ONNX include interoperability of frameworks and hardware optimization.'
|
23 |
+
question = 'What are advantages of ONNX?'
|
24 |
+
tokenizer = AutoTokenizer.from_pretrained('roberta-base')
|
25 |
+
|
26 |
+
inputs = tokenizer(question, context, padding=True, truncation=True, return_tensors='np')
|
27 |
+
inputs_int64 = {key: np.array(inputs[key], dtype=np.int64) for key in inputs}
|
28 |
+
outputs = onnx_model.run(input_feed=dict(inputs_int64), output_names=None)
|
29 |
+
```
|
30 |
+
|
31 |
+
## Architecture & Training
|
32 |
+
|
33 |
+
The training code for this adapter is available at https://github.com/adapter-hub/efficient-task-transfer.
|
34 |
+
In particular, training configurations for all tasks can be found [here](https://github.com/adapter-hub/efficient-task-transfer/tree/master/run_configs).
|
35 |
+
|
36 |
+
|
37 |
+
## Evaluation results
|
38 |
+
|
39 |
+
Refer to [the paper](https://arxiv.org/pdf/2104.08247) for more information on results.
|
40 |
+
|
41 |
+
## Citation
|
42 |
+
|
43 |
+
If you use this adapter, please cite our paper ["What to Pre-Train on? Efficient Intermediate Task Selection"](https://arxiv.org/pdf/2104.08247):
|
44 |
+
|
45 |
+
```bibtex
|
46 |
+
@inproceedings{poth-etal-2021-pre,
|
47 |
+
title = "{W}hat to Pre-Train on? {E}fficient Intermediate Task Selection",
|
48 |
+
author = {Poth, Clifton and
|
49 |
+
Pfeiffer, Jonas and
|
50 |
+
R{"u}ckl{'e}, Andreas and
|
51 |
+
Gurevych, Iryna},
|
52 |
+
booktitle = "Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing",
|
53 |
+
month = nov,
|
54 |
+
year = "2021",
|
55 |
+
address = "Online and Punta Cana, Dominican Republic",
|
56 |
+
publisher = "Association for Computational Linguistics",
|
57 |
+
url = "https://aclanthology.org/2021.emnlp-main.827",
|
58 |
+
pages = "10585--10605",
|
59 |
+
}
|
60 |
+
```
|