transformers icon indicating copy to clipboard operation
transformers copied to clipboard

Added OnnxConfig for MPNet models

Open grafail opened this issue 3 years ago • 5 comments

What does this PR do?

This PR Adds OnnxConfig for MPNet based models.

In order for the conversion to be compatible with some older versions of PyTorch (In my case 1.11.0), I had to add *args, to the signature of forward functions that were using **kwargs. This was because _decide_input_format in PyTorch considered **kwargs as a normal parameter so it added an additional (unexpected) positional argument (with value None).

https://github.com/pytorch/pytorch/blob/33bb8ae350611760139457b85842b1d7edf9aa11/torch/onnx/utils.py#L793

Before submitting

Who can review?

@ChainYo

grafail avatar Sep 13 '22 12:09 grafail

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

@ChainYo As I mentioned in the pr description, a function inside torch (with version 1.11) had an issue parsing the signature correctly and provided kwargs as an extra positional argument. Latest version worked though, but I added the fix for compatibility.

grafail avatar Sep 13 '22 13:09 grafail

@ChainYo As I mentioned in the pr description, a function inside torch (with version 1.11) had an issue parsing the signature correctly and provided kwargs as an extra positional argument. The latest version worked, though, but I added the fix for compatibility.

Sorry I didn't read the PR carefully. Let's see if it doesn't bother the original implementation by bringing any unexpected behaviors. It's okay, then. :hugs:

chainyo avatar Sep 14 '22 07:09 chainyo

Is there anything I can do to help with this?

grafail avatar Sep 21 '22 08:09 grafail

Is there anything I can do to help with this?

We are waiting for a reviewer to get feedback and see what's next!

chainyo avatar Sep 21 '22 09:09 chainyo

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Oct 24 '22 15:10 github-actions[bot]

This is still an issue

ghost avatar Oct 06 '23 21:10 ghost