Support non-string values in JSON keys from CLI (#19471)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-06-11 17:34:04 +08:00
committed by GitHub
parent 871d6b7c74
commit a2142f0196
3 changed files with 49 additions and 25 deletions

View File

@@ -272,6 +272,15 @@ def test_dict_args(parser):
"val5",
"--hf_overrides.key-7.key_8",
"val6",
# Test data type detection
"--hf_overrides.key9",
"100",
"--hf_overrides.key10",
"100.0",
"--hf_overrides.key11",
"true",
"--hf_overrides.key12.key13",
"null",
]
parsed_args = parser.parse_args(args)
assert parsed_args.model_name == "something.something"
@@ -286,6 +295,12 @@ def test_dict_args(parser):
"key-7": {
"key_8": "val6",
},
"key9": 100,
"key10": 100.0,
"key11": True,
"key12": {
"key13": None,
},
}