Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
96c3329f
Unverified
Commit
96c3329f
authored
Aug 12, 2020
by
Sylvain Gugger
Committed by
GitHub
Aug 12, 2020
Browse files
Fix #6428 (#6437)
parent
a8db954c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/hf_argparser.py
src/transformers/hf_argparser.py
+2
-2
No files found.
src/transformers/hf_argparser.py
View file @
96c3329f
...
@@ -4,7 +4,7 @@ import sys
...
@@ -4,7 +4,7 @@ import sys
from
argparse
import
ArgumentParser
from
argparse
import
ArgumentParser
from
enum
import
Enum
from
enum
import
Enum
from
pathlib
import
Path
from
pathlib
import
Path
from
typing
import
Any
,
Iterable
,
List
,
NewType
,
Tuple
,
Union
from
typing
import
Any
,
Iterable
,
List
,
NewType
,
Optional
,
Tuple
,
Union
DataClass
=
NewType
(
"DataClass"
,
Any
)
DataClass
=
NewType
(
"DataClass"
,
Any
)
...
@@ -64,7 +64,7 @@ class HfArgumentParser(ArgumentParser):
...
@@ -64,7 +64,7 @@ class HfArgumentParser(ArgumentParser):
kwargs
[
"type"
]
=
field
.
type
kwargs
[
"type"
]
=
field
.
type
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
:
elif
field
.
type
is
bool
or
field
.
type
is
Optional
[
bool
]
:
kwargs
[
"action"
]
=
"store_false"
if
field
.
default
is
True
else
"store_true"
kwargs
[
"action"
]
=
"store_false"
if
field
.
default
is
True
else
"store_true"
if
field
.
default
is
True
:
if
field
.
default
is
True
:
field_name
=
f
"--no-
{
field
.
name
}
"
field_name
=
f
"--no-
{
field
.
name
}
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment