ONNX export of Adapter hSterz/narrativeqa
for facebook/bart-base
Usage
onnx_path = hf_hub_download(repo_id='UKP-SQuARE/narrativeqa-onnx', filename='model.onnx')
onnx_model = InferenceSession(onnx_path, providers=['CPUExecutionProvider'])
context = 'ONNX is an open format to represent models. The benefits of using ONNX include interoperability of frameworks and hardware optimization.'
question = 'What are advantages of ONNX?'
tokenizer = AutoTokenizer.from_pretrained('UKP-SQuARE/narrativeqa-onnx')
inputs = tokenizer(question, context, padding=True, truncation=True, return_tensors='np')
outputs = onnx_model.run(input_feed=dict(inputs), output_names=None)
Architecture & Training
Evaluation results
Citation