huggingface / huggingface/controlnet_aux

Bug/Suggestion: Don't Parse Global Sys Args With Allowing Abbreviations

Open
#121 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
497
Forks
104
PR merge metrics
No merged PRs in 30d

Description

In the `LeresDetector` it runs `TestOptions().parse()` which parses global `sys.argv` with abbreviations allowed.

When this package is used in environments such as Azure ML Endpoints there exists an `--output` sys arg that Leres then crashes on with the error `error: ambiguous option: --output could match --output_nc, --output_dir, --output_resolution`

Since this is a package that can be used in environments such as that, I suggest we turn off the [allow abbreviations](https://docs.python.org/3/library/argparse.html#allow-abbrev) in the [ArgumentParser](https://github.com/huggingface/controlnet_aux/blob/master/src/controlnet_aux/leres/pix2pix/options/base_options.py#L86C1-L87C1)

I think the default is fine when using from the command line on its own but as a package I think it should be configurable or set to `False`

This also exists in other classes but this is the one I'm concerned with.

What do you all think?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.