Skip to content

Commit

Permalink
[Bugfix] Fix FlexibleArgumentParser replaces _ with - for actual args
Browse files Browse the repository at this point in the history
- processed_args.append('--' + arg[len('--'):].replace('_', '-')) will
replace args like '--image-input-type=pixel_values' to
'--image-input-type=pixel-values'
  • Loading branch information
CatherineSue committed Jun 24, 2024
1 parent c246212 commit 92d0d49
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vllm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,13 @@ def parse_args(self, args=None, namespace=None):
processed_args = []
for arg in args:
if arg.startswith('--'):
processed_args.append('--' + arg[len('--'):].replace('_', '-'))
if '=' in arg:
key, value = arg.split('=', 1)
key = '--' + key[len('--'):].replace('_', '-')
processed_args.append(f'{key}={value}')
else:
processed_args.append('--' +
arg[len('--'):].replace('_', '-'))
else:
processed_args.append(arg)

Expand Down

0 comments on commit 92d0d49

Please sign in to comment.