This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
python 3.8 parser fix on args_that_override #4507
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Patch description
I'm running into an issue where the
opt['override']
doesn't contain all the arguments in command lines, e.g. when running-m XXX
, the key'model'
isn't inopt['override']
.My understanding is it's due to single dash isn't handled properly at the _process_args_to_opts. The option
_strings_dict
in python>=3.8 has all the doubledashes and no singledash{....'--model': 'model', '--m': 'model', '--model-file': 'model_file', '--mf': 'model_file', '--im': 'init_model', ...}
however the args_that_override has both single and double dashes.
Notice that unlike
_handle_single_dash_addarg
where the input consists of only args (e.g.args = ('--help', '-h')
) and output reordered args, in_handle_single_dash_parsearg
the input consists of args and values (e.g.args = ['i', '--mf', 'zoo:blenderbot2/blenderbot2_400M/model', '--search-server', 'devfair0169:3005/search_server', '--knowledge-access-method', 'classify', '--query-generator-model-file', 'zoo:sea/bart_sq_gen/model', '--m', '....agents', ...]
), and therefore shouldn't be reorderedTesting steps
Other information