huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
132.31k stars 26.35k forks source link

How to export to ONNX distilbert with question-answering head #13908

Closed ankandrew closed 2 years ago

ankandrew commented 2 years ago

I am having a little bit of trouble exporting to ONNX: distilbert with question-answering head.

Code

I convert to ONNX according to docs:

# Convert to ONNX
!python -m transformers.onnx --model='mrm8488/distill-bert-base-spanish-wwm-cased-finetuned-spa-squad2-es' --feature question-answering 'onnx_exported'

But --feature question-answering seems like is not an acceptable feature.

Is this expected?

Versions

transformers    4.11.2
Python      3.7.12

Inquiry

The reason I am doing this is to run pipeline with onnx and get extra juice out of it (performance). Is there a better way than this manual export approach?

LysandreJik commented 2 years ago

I don't think the question-answering head is implemented, cc @michaelbenayoun

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.