Skip to content
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 config for generating ONNX models for table-transformers #20744

Closed

Conversation

antew
Copy link

@antew antew commented Dec 13, 2022

What does this PR do?

Allows generating ONNX models for table-transformers.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@NielsRogge - This adds a small bit on top of the work you did in #19614 to allow generating ONNX models for table transfomers (e.g. python -m transformers.onnx --model="microsoft/table-transformer-structure-recognition" table/)

Without this addition, I was getting this error:

KeyError: "table-transformer is not supported yet.
Only ['albert', 'bart', 'beit', 'bert', 'big-bird', 'bigbird-pegasus', 'blenderbot', 'blenderbot-small', 'bloom', 'camembert', 'clip', 'codegen', 'convbert', 'convnext', 'data2vec-text', 'data2vec-vision', 'deberta', 'deberta-v2', 'deit', 'detr', 'distilbert', 'electra', 'flaubert', 'gpt2', 'gptj', 'gpt-neo', 'groupvit', 'ibert', 'imagegpt', 'layoutlm', 'layoutlmv3', 'levit', 'longt5', 'longformer', 'marian', 'mbart', 'mobilebert', 'mobilenet_v1', 'mobilenet_v2', 'mobilevit', 'mt5', 'm2m-100', 'owlvit', 'perceiver', 'resnet', 'roberta', 'roformer', 'segformer', 'squeezebert', 'swin', 't5', 'vision-encoder-decoder', 'vit', 'whisper', 'xlm', 'xlm-roberta', 'yolos'] 
are supported. If you want to support table-transformer please propose a PR or open up an issue.

@antew antew force-pushed the add-onnx-support-for-table-transformers branch from d981b1c to a0a68c8 Compare December 13, 2022 05:33
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@sgugger
Copy link
Collaborator

sgugger commented Dec 13, 2022

Note that we don't accept new model exports in Transformers, as we moved that part into the Optimum library. You should open a PR to add support there :-)

@antew
Copy link
Author

antew commented Dec 13, 2022

Note that we don't accept new model exports in Transformers, as we moved that part into the Optimum library. You should open a PR to add support there :-)

Thank you @sgugger, will do!

@antew antew closed this Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants