"docker/vscode:/vscode.git/clone" did not exist on "f7ce4f1ff789c11f129597a1171b5d549d102e09"
Unverified Commit c526bde3 authored by Benjamin Fineran's avatar Benjamin Fineran Committed by GitHub
Browse files

fix typing error for HfArgumentParser for Optional[bool] (#10672)

* fix typing error for TrainingArguments Optional[bool]

* updating equality check for Optional[bool]
parent fa1a8d10
...@@ -99,7 +99,7 @@ class HfArgumentParser(ArgumentParser): ...@@ -99,7 +99,7 @@ class HfArgumentParser(ArgumentParser):
kwargs["type"] = type(kwargs["choices"][0]) kwargs["type"] = type(kwargs["choices"][0])
if field.default is not dataclasses.MISSING: if field.default is not dataclasses.MISSING:
kwargs["default"] = field.default kwargs["default"] = field.default
elif field.type is bool or field.type is Optional[bool]: elif field.type is bool or field.type == Optional[bool]:
if field.default is True: if field.default is True:
self.add_argument(f"--no_{field.name}", action="store_false", dest=field.name, **kwargs) self.add_argument(f"--no_{field.name}", action="store_false", dest=field.name, **kwargs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment