Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
bb9559a7
Unverified
Commit
bb9559a7
authored
Oct 14, 2020
by
Sylvain Gugger
Committed by
GitHub
Oct 14, 2020
Browse files
Don't use `store_xxx` on optional bools (#7786)
* Don't use `store_xxx` on optional bools * Refine test * Refine test
parent
a1d1b332
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
8 deletions
+9
-8
examples/test_xla_examples.py
examples/test_xla_examples.py
+1
-1
examples/text-classification/README.md
examples/text-classification/README.md
+1
-1
src/transformers/hf_argparser.py
src/transformers/hf_argparser.py
+2
-1
src/transformers/training_args.py
src/transformers/training_args.py
+1
-1
valohai.yaml
valohai.yaml
+4
-4
No files found.
examples/test_xla_examples.py
View file @
bb9559a7
...
@@ -59,7 +59,7 @@ class TorchXLAExamplesTests(unittest.TestCase):
...
@@ -59,7 +59,7 @@ class TorchXLAExamplesTests(unittest.TestCase):
--model_name_or_path=bert-base-cased
--model_name_or_path=bert-base-cased
--per_device_train_batch_size=64
--per_device_train_batch_size=64
--per_device_eval_batch_size=64
--per_device_eval_batch_size=64
--evaluat
e_during_training
--evaluat
ion_strategy steps
--overwrite_cache
--overwrite_cache
"""
.
split
()
"""
.
split
()
with
patch
.
object
(
sys
,
"argv"
,
testargs
):
with
patch
.
object
(
sys
,
"argv"
,
testargs
):
...
...
examples/text-classification/README.md
View file @
bb9559a7
...
@@ -43,7 +43,7 @@ python run_tf_text_classification.py \
...
@@ -43,7 +43,7 @@ python run_tf_text_classification.py \
--do_eval
\
--do_eval
\
--do_predict
\
--do_predict
\
--logging_steps
10
\
--logging_steps
10
\
--evaluat
e_during_training
\
--evaluat
ion_strategy
steps
\
--save_steps
10
\
--save_steps
10
\
--overwrite_output_dir
\
--overwrite_output_dir
\
--max_seq_length
128
--max_seq_length
128
...
...
src/transformers/hf_argparser.py
View file @
bb9559a7
...
@@ -65,7 +65,8 @@ class HfArgumentParser(ArgumentParser):
...
@@ -65,7 +65,8 @@ class HfArgumentParser(ArgumentParser):
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
is
Optional
[
bool
]:
kwargs
[
"action"
]
=
"store_false"
if
field
.
default
is
True
else
"store_true"
if
field
.
type
is
bool
or
(
field
.
default
is
not
None
and
field
.
default
is
not
dataclasses
.
MISSING
):
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
}
"
kwargs
[
"dest"
]
=
field
.
name
kwargs
[
"dest"
]
=
field
.
name
...
...
src/transformers/training_args.py
View file @
bb9559a7
...
@@ -191,7 +191,7 @@ class TrainingArguments:
...
@@ -191,7 +191,7 @@ class TrainingArguments:
do_eval
:
bool
=
field
(
default
=
None
,
metadata
=
{
"help"
:
"Whether to run eval on the dev set."
})
do_eval
:
bool
=
field
(
default
=
None
,
metadata
=
{
"help"
:
"Whether to run eval on the dev set."
})
do_predict
:
bool
=
field
(
default
=
False
,
metadata
=
{
"help"
:
"Whether to run predictions on the test set."
})
do_predict
:
bool
=
field
(
default
=
False
,
metadata
=
{
"help"
:
"Whether to run predictions on the test set."
})
evaluate_during_training
:
bool
=
field
(
evaluate_during_training
:
bool
=
field
(
default
=
Non
e
,
default
=
Fals
e
,
metadata
=
{
"help"
:
"Run evaluation during training at each logging step."
},
metadata
=
{
"help"
:
"Run evaluation during training at each logging step."
},
)
)
evaluation_strategy
:
EvaluationStrategy
=
field
(
evaluation_strategy
:
EvaluationStrategy
=
field
(
...
...
valohai.yaml
View file @
bb9559a7
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
pass-as
:
--output_dir={v}
pass-as
:
--output_dir={v}
type
:
string
type
:
string
default
:
/valohai/outputs
default
:
/valohai/outputs
-
name
:
evaluat
e_during_training
-
name
:
evaluat
ion_strategy
description
:
Run
evaluation
during training at each logging step
.
description
:
The
evaluation
strategy to use
.
type
:
fla
g
type
:
strin
g
default
:
true
default
:
steps
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