Improve typing in TrainingArgument (#36944)

* Better error message in TrainingArgument typing checks

* Better typing

* Small fixes

Signed-off-by: cyy <cyyever@outlook.com>

---------

Signed-off-by: cyy <cyyever@outlook.com>
This commit is contained in:
Yuanyuan Chen
2025-05-21 21:54:38 +08:00
committed by GitHub
parent 174684a9b6
commit ae3e4e2d97
2 changed files with 8 additions and 8 deletions

View File

@@ -446,7 +446,7 @@ class HfArgumentParserTest(unittest.TestCase):
self.assertEqual(
len(raw_dict_fields),
0,
"Found invalid raw `dict` types in the `TrainingArgument` typings. "
f"Found invalid raw `dict` types in the `TrainingArgument` typings, which are {raw_dict_fields}. "
"This leads to issues with the CLI. Please turn this into `typing.Optional[dict,str]`",
)