Skip to content

Levit conversion file argparser bug #20937

@Bearnardd

Description

@Bearnardd

Who can help?

@NielsRogge

Reproduction

In the conversion file for the levit model (convert_levit_timm_to_pytorch.py) there is a wrong usage of argparse.ArgumentParser() for the --push_to_hub argument. Currently it is handled with the type bool but in the argparser bool type does not work as expected and the current code always generates push_to_hub=True not matter if in the CLI we use --push_to_hub=False or --push_to_hub=True. More canonical convention of handling boolean values with the argparser is to use two arguments. As an example: --no-push_to_hub to store False values and --push_to_hub to store True values.

Expected behavior

Correct usage of the argparser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions