midav commited on
Commit
af09cc3
1 Parent(s): 1d5f7f5

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +60 -0
README.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ inference: false
3
+ tags:
4
+ - onnx
5
+ - roberta
6
+ - adapter-transformers
7
+ datasets:
8
+ - quartz
9
+ language:
10
+ - en
11
+ ---
12
+
13
+ # ONNX export of Adapter `AdapterHub/roberta-base-pf-quartz` for roberta-base
14
+ ## Conversion of [AdapterHub/roberta-base-pf-quartz](https://huggingface.co/AdapterHub/roberta-base-pf-quartz) for UKP SQuARE
15
+
16
+
17
+ ## Usage
18
+ ```python
19
+ onnx_path = hf_hub_download(repo_id='UKP-SQuARE/roberta-base-pf-quartz-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
+ choices = ["Cat", "Horse", "Tiger", "Fish"]tokenizer = AutoTokenizer.from_pretrained('UKP-SQuARE/roberta-base-pf-quartz-onnx')
25
+
26
+ raw_input = [[context, question + + choice] for choice in choices]
27
+ inputs = tokenizer(raw_input, padding=True, truncation=True, return_tensors="np")
28
+ inputs['token_type_ids'] = np.expand_dims(inputs['token_type_ids'], axis=0)
29
+ inputs['input_ids'] = np.expand_dims(inputs['input_ids'], axis=0)
30
+ inputs['attention_mask'] = np.expand_dims(inputs['attention_mask'], axis=0)
31
+ outputs = onnx_model.run(input_feed=dict(inputs), output_names=None)
32
+ ```
33
+
34
+ ## Architecture & Training
35
+
36
+ The training code for this adapter is available at https://github.com/adapter-hub/efficient-task-transfer.
37
+ In particular, training configurations for all tasks can be found [here](https://github.com/adapter-hub/efficient-task-transfer/tree/master/run_configs).
38
+
39
+
40
+ ## Evaluation results
41
+
42
+ Refer to [the paper](https://arxiv.org/pdf/2104.08247) for more information on results.
43
+
44
+ ## Citation
45
+
46
+ If you use this adapter, please cite our paper ["What to Pre-Train on? Efficient Intermediate Task Selection"](https://arxiv.org/pdf/2104.08247):
47
+
48
+ ```bibtex
49
+ @inproceedings{poth-etal-2021-what-to-pre-train-on,
50
+ title={What to Pre-Train on? Efficient Intermediate Task Selection},
51
+ author={Clifton Poth and Jonas Pfeiffer and Andreas Rücklé and Iryna Gurevych},
52
+ booktitle = "Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
53
+ month = nov,
54
+ year = "2021",
55
+ address = "Online",
56
+ publisher = "Association for Computational Linguistics",
57
+ url = "https://arxiv.org/abs/2104.08247",
58
+ pages = "to appear",
59
+ }
60
+ ```