transformers
                                
                                 transformers copied to clipboard
                                
                                    transformers copied to clipboard
                            
                            
                            
                        Added OnnxConfig for MPNet models
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
- [x] Did you read the contributor guideline, Pull Request section?
- [x] Was this discussed/approved via a Github issue or the forum? Please add a link to it if that's the case. #16308
- [x] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
- [x] Did you write any new necessary tests?
Who can review?
@ChainYo
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.
@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:
Is there anything I can do to help with this?
Is there anything I can do to help with this?
We are waiting for a reviewer to get feedback and see what's next!
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.
This is still an issue