Add ONNX export for ViT (#15658)

* Add ONNX support for ViT

* Refactor to use generic preprocessor

* Add vision dep to tests

* Extend ONNX slow tests to ViT

* Add dummy image generator

* Use model_type to determine modality

* Add deprecation warnings for tokenizer argument

* Add warning when overwriting the preprocessor

* Add optional args to docstrings

* Add minimum PyTorch version to OnnxConfig

* Refactor OnnxConfig class variables from CONSTANT_NAME to snake_case

* Add reasonable value for default atol

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
This commit is contained in:
lewtun
2022-03-09 17:36:59 +01:00
committed by GitHub
parent b7fa1e3dee
commit 50dd314d93
12 changed files with 270 additions and 91 deletions

View File

@@ -62,6 +62,7 @@ Ready-made configurations include the following architectures:
- PLBart
- RoBERTa
- T5
- ViT
- XLM-RoBERTa
- XLM-RoBERTa-XL