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.
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
Add ONNX export for ViT #15658
Changes from 8 commits
8fce819
5e15830
be90f25
81287ec
8103587
bcbdbd9
12a5306
ba0a7b0
0ebbcae
d179861
b1b4f61
b0491e8
7f03d43
26dcdde
99dd9a7
41fa7e0
5ce5801
84bcfaa
fcca7dc
687d436
e4e3343
8207be1
ade513f
a7baf9a
d898037
88d25cf
941689b
31dd4f9
d1f9397
49dca94
aec42f8
750db82
951df50
48129a7
b2e618e
1514807
7ac6312
81eedea
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
We shouldn't have absolute imports mixed with relative imports, so everything should be relative imports.
Also
PreTrainedTokenizerFast
should not be imported outside of a check foris_tokenizers_available
but I don't think you really need it.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.
Thanks for the advice. Here I was just following what already existed, but I'll take care of the relative imports in this PR too :)
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.
This base method now has a mix of arguments for text and image modalities. I'm not 100% sure if we should split the modalities apart ...
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.
You split it now right? Just checking to make sure.
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.
We just tested if the
preprocessor
is a tokenizer and iftokenizer
is not None above and returned an error. This branch will never be reached.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.
Good catch! I found it was convenient to re-order the test so that we overwrite the
preprocessor
arg only ifpreprocessor=None
andtokenizer
is notNone
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.
Same here. All the imports are a mess of relative and absolute. This should all be relative.