-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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 LayoutLMv2 to models exportable with ONNX #14555
Changes from 1 commit
69be0c9
331cf95
b24aaee
b1b50fd
cdd94b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,7 @@ def export( | |
raise ValueError("Model and config inputs doesn't match") | ||
|
||
if isinstance(model.base_model, LayoutLMv2Model): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is problematic because export should be somehow agnostic to the model to export. You can do this by providing a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will look into it. |
||
|
||
class PoolerLayer(nn.Module): | ||
def __init__(self): | ||
super(PoolerLayer, self).__init__() | ||
|
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 do not need to override this as you are simply calling the base clase
__init__
method.