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

Fix issue introduced in PR #23163 #23363

Merged
merged 2 commits into from
May 15, 2023
Merged

Fix issue introduced in PR #23163 #23363

merged 2 commits into from
May 15, 2023

Conversation

ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented May 15, 2023

What does this PR do?

Fix issue introduced in PR #23163.

The previous torch_version is removed (which is not a string but a version type), and get_torch_version() is introduced and used (which is a string). In some places, it is compared against self.torch_onnx_minimum_version which is a string, and we know get on CI TypeError: '<' not supported between instances of 'str' and 'Version'.

This PR fixes this problem and avoid the > 1000 test failures.

(cc. @apbard FYI)

@@ -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
Copy link
Collaborator Author

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

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented May 15, 2023

The documentation is not available anymore as the PR was closed or merged.

@ydshieh
Copy link
Collaborator Author

ydshieh commented May 15, 2023

FYI, after #23163, is_bs4_available() and is_faiss_available() gives False even if they are actually available. This causes some CI errors, in particularly, MarkupLM.

I will fix this in a separate PR.

Copy link
Collaborator

@amyeroberts amyeroberts 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 fixing!

@ydshieh ydshieh merged commit 81a73fa into main May 15, 2023
@ydshieh ydshieh deleted the fix_ver branch May 15, 2023 09:38
@ydshieh ydshieh changed the title fix Fix issue introduced in PR #23163 May 15, 2023
sheonhan pushed a commit to sheonhan/transformers that referenced this pull request Jun 1, 2023
gojiteji pushed a commit to gojiteji/transformers that referenced this pull request Jun 5, 2023
novice03 pushed a commit to novice03/transformers that referenced this pull request Jun 23, 2023
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