Skip to content

Fix wrong argparse type in modular checker script #37472

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

Merged

Conversation

seven-mile
Copy link
Contributor

What does this PR do?

In the argparse library, the type parameter is applied to each argument individually. When using type=list in combination with nargs="+", the command python utils/check_modular_conversion.py --files abc def is parsed as [['a', 'b', 'c'], ['d', 'e', 'f']]. This behavior occurs because the script typically relies on no arguments being passed, defaulting to ['all'], which has allowed it to function correctly until now.

This PR corrects this behaviour.

CC: @ArthurZucker

@github-actions github-actions bot marked this pull request as draft April 13, 2025 06:07
Copy link

Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the Ready for review button (at the bottom of the PR page). This will assign reviewers and trigger CI.

@seven-mile seven-mile marked this pull request as ready for review April 13, 2025 06:09
@Rocketknight1 Rocketknight1 force-pushed the fix-check-modular-conv-argparse branch from 57ea113 to 37721fb Compare April 14, 2025 14:57
Copy link
Member

@Rocketknight1 Rocketknight1 left a comment

Choose a reason for hiding this comment

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

Yep, this is correct!

@Rocketknight1 Rocketknight1 merged commit a5dfb98 into huggingface:main Apr 14, 2025
8 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