narrativeqa-onnx / README.md
phlippseitz's picture
Upload README.md with huggingface_hub
2afd5bb
|
raw
history blame
1.12 kB
metadata
inference: false
tags:
  - onnx
  - adapterhub:qa/narrativeqa
  - adapter-transformers
  - bart
datasets:
  - narrativeqa

ONNX export of Adapter hSterz/narrativeqa for facebook/bart-base

Conversion of AdapterHub/narrativeqa for UKP SQuARE

Usage

onnx_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)

Architecture & Training

Evaluation results

Citation