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
obj-det
pipeline support forLayoutLMV2
#13622Add
obj-det
pipeline support forLayoutLMV2
#13622Changes from 22 commits
302831e
2a265ef
fd7d47b
6b44c80
0964a63
18d3805
ad7d9b2
a1267ca
af6886b
61c7df2
85e40a4
59ec807
6796027
64c2df5
52bcdbe
12d3205
6f69e80
f3248a6
0704a05
9a8eadf
05db577
6589fb0
01509bf
3e3d626
df86d51
2cedc54
d8bdd19
3825a41
5ac49f8
907c4f4
c93385e
6004132
defd574
e610734
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.
Can you still import
LayoutLMv2FeatureExtractor
when you don't have torch installed?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.
With lazy loading, all classes are None if the various requirements are not met I think
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.
Can you check this @mishig25?
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.
Not sure if this answers your question. Added import torch lines because the newly added
post_process
method depends on torchtransformers/src/transformers/models/layoutlmv2/feature_extraction_layoutlmv2.py
Lines 239 to 244 in 01509bf
Should I move the import torch statement inside
post_process
method ?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.
cc'ing @LysandreJik here to check what's the best option
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 would keep the import torch statement at the top level. Moving it inside the
post_process
function means it might crash once a program is well into progress, which can be painful. I'd rather it fail early on.