Skip to content

Make convert_to_onnx runable as script again#20009

Merged
sgugger merged 2 commits intohuggingface:mainfrom
mcernusca:patch-1
Dec 5, 2022
Merged

Make convert_to_onnx runable as script again#20009
sgugger merged 2 commits intohuggingface:mainfrom
mcernusca:patch-1

Conversation

@mcernusca
Copy link
Contributor

Fix convert_graph_to_onnx.py script crash by replacing relative import.

What does this PR do?

Fixes python transformers/convert_graph_to_onnx.py crash with error Error while converting the model: attempted relative import with no known parent package . I found this was previously fixed in #10857 and regressed.

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?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Fix `convert_graph_to_onnx.py` relative import so it can be run as a script again.
Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@sgugger
Copy link
Collaborator

sgugger commented Nov 1, 2022

It seems there is an issue with your CircleCI permissions, the tests won't run.
Could you try refreshing your permissions as shown here?

@HuggingFaceDocBuilderDev

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

@mcernusca
Copy link
Contributor Author

mcernusca commented Nov 1, 2022

It seems there is an issue with your CircleCI permissions, the tests won't run. Could you try refreshing your permissions as shown here?

Thanks, CircleCI supposedly has access to all my repositories now but I'm not sure how to re-trigger the tests. Sorry if I'm missing something obvious.

@sgugger
Copy link
Collaborator

sgugger commented Nov 2, 2022

You can try an empty commit (git commit -m "Trigger CI" --allow-empty)

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2022

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.

@sgugger
Copy link
Collaborator

sgugger commented Dec 5, 2022

Sorry it fell under our radar. Don't hesitate to ping me next time it happens!

@sgugger sgugger merged commit 8ea6694 into huggingface:main Dec 5, 2022
@mcernusca mcernusca deleted the patch-1 branch December 5, 2022 16:28
mpierrau pushed a commit to mpierrau/transformers that referenced this pull request Dec 15, 2022
* Make convert_to_onnx runable as script again

Fix `convert_graph_to_onnx.py` relative import so it can be run as a script again.

* Trigger CI
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.

3 participants