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: AttributeError: module 'packaging' has no attribute 'version' #1660

Merged

Conversation

soulteary
Copy link
Contributor

@soulteary soulteary commented Jan 20, 2024

What does this PR do?

An error occurred while using optimum run Whisper-v3.

Someone in the community has given feedback:

problem also in langchain:

Fixes #1659

Although the error is reported because there is no need to call Optimum, in Utils, due to the problem of how to import the function, an error will occur when running the code in the Python 3.10 environment.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Copy link
Collaborator

@fxmarty fxmarty left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the fix - wonder why this was not catched in the CI

@fxmarty
Copy link
Collaborator

fxmarty commented Jan 22, 2024

@soulteary Could you fix the error there?

    @contextmanager
    def require_numpy_strictly_lower(version: str, message: str):
>       if not version.parse(np.__version__) < version.parse(version):
E       AttributeError: 'str' object has no attribute 'parse'

../optimum/utils/import_utils.py:198: AttributeError
============================== slowest durations ===============================
0.88s call     tests/exporters/onnx/test_onnx_config_loss.py::TestOnnxConfigWithLoss::test_onnx_config_with_loss

(92 durations < 0.005s hidden.  Use -vv to show these durations.)
=========================== short test summary info ============================
FAILED exporters/onnx/test_onnx_config_loss.py::TestOnnxConfigWithLoss::test_onnx_config_with_loss - AttributeError: 'str' object has no attribute 'parse'
======================== 1 failed, 30 skipped in 6.78s =========================

Copy link
Collaborator

@fxmarty fxmarty left a comment

Choose a reason for hiding this comment

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

LGTM, failing tests are unrelated. Thank you for the fix!

@fxmarty fxmarty merged commit 4852030 into huggingface:main Feb 14, 2024
51 of 62 checks passed
young-developer pushed a commit to young-developer/optimum that referenced this pull request May 10, 2024
…uggingface#1660)

* fix: fix module 'packaging' has no attribute 'version'

* fix ci

---------

Co-authored-by: fxmarty <9808326+fxmarty@users.noreply.github.com>
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.

Whisper-v3 ValueError: Transformers now supports natively BetterTransformer optimizations
2 participants