Downloads · 30 days
0
UKP-SQuARE/narrativeqa-onnx
narrativeqa-onnx is a machine learning model from UKP-SQuARE. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for adapter-transformers.
Downloads · 30 days
0
Access
Public
Updated Jan 15, 2023
Repo size
1.8 GB
Likes
0
Public
Click a slice to open those files.
.onnx896 MB · 100%
From the Hugging Face model README
hSterz/narrativeqa for facebook/bart-baseonnx_path = hf_hub_download(repo_id='UKP-SQuARE/narrativeqa-onnx', filename='model.onnx') # or model_quant.onnx for quantization
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)