@@ -42,22 +42,42 @@ def test_bad_nullable_kvs(arg):
42
42
nullable_kvs (arg )
43
43
44
44
45
- @pytest .mark .parametrize (("arg" , "expected" ), [
46
- (None , None ),
47
- ("{}" , {}),
48
- ('{"num_crops": 4}' , {
49
- "num_crops" : 4
50
- }),
51
- ('{"foo": {"bar": "baz"}}' , {
52
- "foo" : {
53
- "bar" : "baz"
54
- }
55
- }),
45
+ # yapf: disable
46
+ @pytest .mark .parametrize (("arg" , "expected" , "option" ), [
47
+ (None , None , "mm-processor-kwargs" ),
48
+ ("{}" , {}, "mm-processor-kwargs" ),
49
+ (
50
+ '{"num_crops": 4}' ,
51
+ {
52
+ "num_crops" : 4
53
+ },
54
+ "mm-processor-kwargs"
55
+ ),
56
+ (
57
+ '{"foo": {"bar": "baz"}}' ,
58
+ {
59
+ "foo" :
60
+ {
61
+ "bar" : "baz"
62
+ }
63
+ },
64
+ "mm-processor-kwargs"
65
+ ),
66
+ (
67
+ '{"cast_logits_dtype":"bfloat16","sequence_parallel_norm":true,"sequence_parallel_norm_threshold":2048}' ,
68
+ {
69
+ "cast_logits_dtype" : "bfloat16" ,
70
+ "sequence_parallel_norm" : True ,
71
+ "sequence_parallel_norm_threshold" : 2048 ,
72
+ },
73
+ "override-neuron-config"
74
+ ),
56
75
])
57
- def test_mm_processor_kwargs_prompt_parser (arg , expected ):
76
+ # yapf: enable
77
+ def test_composite_arg_parser (arg , expected , option ):
58
78
parser = EngineArgs .add_cli_args (FlexibleArgumentParser ())
59
79
if arg is None :
60
80
args = parser .parse_args ([])
61
81
else :
62
- args = parser .parse_args (["--mm-processor-kwargs " , arg ])
63
- assert args . mm_processor_kwargs == expected
82
+ args = parser .parse_args ([f "--{ option } " , arg ])
83
+ assert getattr ( args , option . replace ( "-" , "_" )) == expected
0 commit comments