-
Notifications
You must be signed in to change notification settings - Fork 27.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ONNX export for ViT #15658
Merged
Merged
Add ONNX export for ViT #15658
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
8fce819
Add ONNX support for ViT
lewtun 5e15830
Refactor to use generic preprocessor
lewtun be90f25
Refactor
lewtun 81287ec
Fix ONNX conversion for models with fast tokenizers
lewtun 8103587
Fix copies
lewtun bcbdbd9
Add vision to tests
lewtun 12a5306
Remove fixed ViT outputs
lewtun ba0a7b0
Extend ONNX slow tests to ViT
lewtun 0ebbcae
Add dummy image generator
lewtun d179861
Use model_type to determine modality
lewtun b1b4f61
Add deprecation warnings for tokenizer argument
lewtun b0491e8
Add warning when overwriting the preprocessor
lewtun 7f03d43
Add optional args to docstrings
lewtun 26dcdde
Add TODO
lewtun 99dd9a7
Add minimum PyTorch version to OnnxConfig
lewtun 41fa7e0
Merge branch 'master' into vision-onnx-export
lewtun 5ce5801
Fix minimum torch version
lewtun 84bcfaa
Refactor
lewtun fcca7dc
Add vision dependency to CI tests
lewtun 687d436
Tweak docstring
lewtun e4e3343
Add check on torch minimum version
lewtun 8207be1
Merge branch 'master' into vision-onnx-export
lewtun ade513f
Replace absolute imports with relative ones
lewtun a7baf9a
Apply Sylvain's suggestions from code review
lewtun d898037
Merge remote-tracking branch 'origin/vision-onnx-export' into vision-…
lewtun 88d25cf
Fix imports
lewtun 941689b
Refactor OnnxConfig class variables from CONSTANT_NAME to snake_case
lewtun 31dd4f9
Fix ViT torch version
lewtun d1f9397
Fix docstring
lewtun 49dca94
Fix imports and add logging
lewtun aec42f8
Use relative imports for real this time and use type checking
lewtun 750db82
Add check for vision feature extractor
lewtun 951df50
Refactor imports for type checking
lewtun 48129a7
Skip ONNX test if torch version is incompatible
lewtun b2e618e
Revert ImportError vs AssertionError
lewtun 1514807
Revert gitignore
lewtun 7ac6312
Replace ImportError with warning
lewtun 81eedea
Add reasonable value for default atol
lewtun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the vision dependency here to the CI tests. I couldn't see any other files in
.github/workflows
where I needed to add it, but please let me know otherwise