-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Fix issue introduced in PR #23163 #23363
Conversation
@@ -234,7 +234,7 @@ def is_torch_support_available(self) -> bool: | |||
if is_torch_available(): | |||
from transformers.utils import get_torch_version | |||
|
|||
return get_torch_version() >= self.torch_onnx_minimum_version | |||
return version.parse(get_torch_version()) >= self.torch_onnx_minimum_version |
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.
type Error without this PR
The documentation is not available anymore as the PR was closed or merged. |
FYI, after #23163, I will fix this in a separate PR. |
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.
Thanks for fixing!
* fix * fix --------- Co-authored-by: ydshieh <[email protected]>
* fix * fix --------- Co-authored-by: ydshieh <[email protected]>
* fix * fix --------- Co-authored-by: ydshieh <[email protected]>
What does this PR do?
Fix issue introduced in PR #23163.
The previous
torch_version
is removed (which is not a string but aversion
type), andget_torch_version()
is introduced and used (which is a string). In some places, it is compared againstself.torch_onnx_minimum_version
which is a string, and we know get on CITypeError: '<' not supported between instances of 'str' and 'Version'
.This PR fixes this problem and avoid the > 1000 test failures.
(cc. @apbard FYI)