File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 2424
2525import yaml
2626from pydantic import (
27+ AliasChoices ,
28+ AliasGenerator ,
2729 ConfigDict ,
2830 Field ,
2931 ValidationError ,
@@ -1832,6 +1834,14 @@ def get_default(cls: type[BenchmarkGenerativeTextArgs], field: str) -> Any:
18321834 use_enum_values = True ,
18331835 from_attributes = True ,
18341836 arbitrary_types_allowed = True ,
1837+ validate_by_alias = True ,
1838+ validate_by_name = True ,
1839+ alias_generator = AliasGenerator (
1840+ # Support field names with hyphens
1841+ validation_alias = lambda field_name : AliasChoices (
1842+ field_name , field_name .replace ("_" , "-" )
1843+ ),
1844+ ),
18351845 )
18361846
18371847 # Required
@@ -1878,6 +1888,7 @@ def get_default(cls: type[BenchmarkGenerativeTextArgs], field: str) -> Any:
18781888 data_request_formatter : DatasetPreprocessor | dict [str , str ] | str = Field (
18791889 default = "chat_completions" ,
18801890 description = "Request formatting preprocessor or template name" ,
1891+ validation_alias = AliasChoices ("request_type" , "request-type" ),
18811892 )
18821893 data_collator : Callable | Literal ["generative" ] | None = Field (
18831894 default = "generative" , description = "Data collator for batch processing"
You can’t perform that action at this time.
0 commit comments