Views
No views yet
AdapterHub/roberta-base-pf-newsqa for roberta-base1onnx_path = hf_hub_download(repo_id='UKP-SQuARE/roberta-base-pf-newsqa-onnx', filename='model.onnx') # or model_quant.onnx for quantization
2onnx_model = InferenceSession(onnx_path, providers=['CPUExecutionProvider'])
3
4context = 'ONNX is an open format to represent models. The benefits of using ONNX include interoperability of frameworks and hardware optimization.'
5question = 'What are advantages of ONNX?'
6tokenizer = AutoTokenizer.from_pretrained('UKP-SQuARE/roberta-base-pf-newsqa-onnx')
7
8inputs = tokenizer(question, context, padding=True, truncation=True, return_tensors='np')
9inputs_int64 = {key: np.array(inputs[key], dtype=np.int64) for key in inputs}
10outputs = onnx_model.run(input_feed=dict(inputs_int64), output_names=None)1@inproceedings{poth-etal-2021-pre,
2 title = "{W}hat to Pre-Train on? {E}fficient Intermediate Task Selection",
3 author = {Poth, Clifton and
4 Pfeiffer, Jonas and
5 R{"u}ckl{'e}, Andreas and
6 Gurevych, Iryna},
7 booktitle = "Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing",
8 month = nov,
9 year = "2021",
10 address = "Online and Punta Cana, Dominican Republic",
11 publisher = "Association for Computational Linguistics",
12 url = "https://aclanthology.org/2021.emnlp-main.827",
13 pages = "10585--10605",
14}