-
Notifications
You must be signed in to change notification settings - Fork 489
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
[TFLite Export] Adds TFLite support for LayoutLMv3 #1372
base: main
Are you sure you want to change the base?
[TFLite Export] Adds TFLite support for LayoutLMv3 #1372
Conversation
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.
Hi @salmanmaq thank you for your contribution, LGTM!
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.
LGTM!
Will wait that the CI goes green to merge. Except for int8 quantization tests that do not seem related to your changes at all.
Hey @fxmarty @michaelbenayoun Would you like to merge this before it goes stale? Happy to update the PR in case it has |
Hi @salmanmaq , |
Thanks @michaelbenayoun. Is it something with the PR, or at your end? You had previously mentioned
Would be checking it out though. If you can give some pointers, I am happy to have a look and attempt a fix. |
@salmanmaq, since there is a suggestion the issue might not be related to your PR, I noticed that your fork is a bit behind, maybe you could pull the latest commits try again? |
Hi @fxmarty @michaelbenayoun . Bringing this to your attention again for a potential merge. I've merged and pushed the latest changes. I've tested LayoutLMv3 conversion (without quantization) and with the supported quantization types (FP16, INT8 dynamic). I am able to successfully convert and use those models. I think the test errors are not related to my code. So I suppose you can consider merging it. If the test errors are due to my code, I am happy to take some guidance and work on those (but I don't think that's the case). |
4901d1d
to
43fbefb
Compare
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
What does this PR do?
Adds support for exporting LayoutLMv3 to TFLite. Some tests for all quantization approaches were failing for some tasks, so I limited the supported quantization schemes for now.
It was primarily based on #813 and the ONNX export code already part of the library.
It can be tested as:
You can export a trained model as:
Before submitting