Skip to content

Conversation

clumsy
Copy link
Contributor

@clumsy clumsy commented Mar 27, 2024

What does this PR do?

mlflow module can be provided by either mlflow or mlflow-skinny packages. The latter is a more lightweight option.

After a recent change the usages of mlflow-skinny are broken for transformers see this discussion:

if packaging.version.parse(importlib.metadata.version("mlflow")) >= packaging.version.parse("2.8.0"):
  File "/opt/conda/lib/python3.9/importlib/metadata.py", line 569, in version
return distribution(distribution_name).version
  File "/opt/conda/lib/python3.9/importlib/metadata.py", line 542, in distribution
return Distribution.from_name(distribution_name)
  File "/opt/conda/lib/python3.9/importlib/metadata.py", line 196, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: mlflow

Fun fact: importlib.util.find_spec("mlflow") is not None check in is_mlflow_available actually passes for mlflow-skinny.

Fixes #29195

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? I didn't find any tests for this functionality at all

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.

@clumsy clumsy force-pushed the fix/mlflow_version_check branch from 0e1abb8 to 35e9636 Compare March 27, 2024 21:52
Copy link
Contributor

@cchen-dialpad cchen-dialpad 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! Maybe need another review from HuggingFace, but otherwise LGTM

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Makes sense! Kudos for the prompt fix and the catch!

@ArthurZucker ArthurZucker merged commit e644b60 into huggingface:main Mar 30, 2024
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@clumsy clumsy deleted the fix/mlflow_version_check branch March 31, 2024 21:42
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.

5 participants