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(utils): Enhance the dependencies check to include pip distribution #317

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

aiqwe
Copy link
Contributor

@aiqwe aiqwe commented Jan 6, 2025

With the 0.4.0 release, Datatrove transitioned to numpy 2.0, and the pyproject.toml was updated to ensure that the version of fasttext used is compatible with numpy 2.x.

However, if users do not start with a totally new virtual environment and just continue using fasttext-wheels compatible with numpy 1.x, we check only verifies the module name fasttext, which can cause an error to be raised during execution.

To solve this issue, I modfied below:

  • add _is_distribution_available in _import_utils to strictly manage pip distributions.
  • modified the check_required_dependencies function to perform above.
  • also modified lid, language_filter, fasttext_filter to check pip distribution fasttext-numpy2-wheel

During pytest, an error related to the Tibetan language occurred, but since it is not relevant to my region, I did not make any additional changes.

@guipenedo guipenedo mentioned this pull request Jan 7, 2025
@guipenedo
Copy link
Collaborator

Thanks a lot! Can you check the "Allow edits from maintainers" checkbox so that I may fix the tests?
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork

@aiqwe
Copy link
Contributor Author

aiqwe commented Jan 9, 2025

@guipenedo thx! 😀

However, the checkbox was already checked when I submitted the PR.

스크린샷 2025-01-10 오전 3 05 45

I think the feature could not be working properly.
If necessary, I’m fine with submitting the PR again after the test code is updated.

@guipenedo
Copy link
Collaborator

my bad, seems to have worked now

@guipenedo guipenedo merged commit 2260603 into huggingface:main Jan 9, 2025
3 of 4 checks passed
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.

2 participants