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
12428f0e
Commit
12428f0e
authored
Mar 23, 2022
by
Sylvain Gugger
Browse files
Fix style
parent
1dfc11e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
src/transformers/trainer_callback.py
src/transformers/trainer_callback.py
+5
-1
src/transformers/training_args.py
src/transformers/training_args.py
+6
-3
No files found.
src/transformers/trainer_callback.py
View file @
12428f0e
...
@@ -416,7 +416,11 @@ class DefaultFlowCallback(TrainerCallback):
...
@@ -416,7 +416,11 @@ class DefaultFlowCallback(TrainerCallback):
control
.
should_log
=
True
control
.
should_log
=
True
# Evaluate
# Evaluate
if
args
.
evaluation_strategy
==
IntervalStrategy
.
STEPS
and
state
.
global_step
%
args
.
eval_steps
==
0
and
args
.
eval_delay
>
state
.
global_step
:
if
(
args
.
evaluation_strategy
==
IntervalStrategy
.
STEPS
and
state
.
global_step
%
args
.
eval_steps
==
0
and
args
.
eval_delay
>
state
.
global_step
):
control
.
should_evaluate
=
True
control
.
should_evaluate
=
True
# Save
# Save
...
...
src/transformers/training_args.py
View file @
12428f0e
...
@@ -139,7 +139,8 @@ class TrainingArguments:
...
@@ -139,7 +139,8 @@ class TrainingArguments:
left unset, the whole predictions are accumulated on GPU/TPU before being moved to the CPU (faster but
left unset, the whole predictions are accumulated on GPU/TPU before being moved to the CPU (faster but
requires more memory).
requires more memory).
eval_delay (`float`, *optional*):
eval_delay (`float`, *optional*):
Number of epochs or steps to wait for before the first evaluation can be performed, depending on the evaluation_strategy.
Number of epochs or steps to wait for before the first evaluation can be performed, depending on the
evaluation_strategy.
learning_rate (`float`, *optional*, defaults to 5e-5):
learning_rate (`float`, *optional*, defaults to 5e-5):
The initial learning rate for [`AdamW`] optimizer.
The initial learning rate for [`AdamW`] optimizer.
weight_decay (`float`, *optional*, defaults to 0):
weight_decay (`float`, *optional*, defaults to 0):
...
@@ -476,8 +477,10 @@ class TrainingArguments:
...
@@ -476,8 +477,10 @@ class TrainingArguments:
eval_delay
:
Optional
[
float
]
=
field
(
eval_delay
:
Optional
[
float
]
=
field
(
default
=
0
,
default
=
0
,
metadata
=
{
"help"
:
"Number of epochs or steps to wait for before the first evaluation can be performed, depending on the evaluation_strategy."
},
metadata
=
{
)
"help"
:
"Number of epochs or steps to wait for before the first evaluation can be performed, depending on the evaluation_strategy."
},
)
learning_rate
:
float
=
field
(
default
=
5e-5
,
metadata
=
{
"help"
:
"The initial learning rate for AdamW."
})
learning_rate
:
float
=
field
(
default
=
5e-5
,
metadata
=
{
"help"
:
"The initial learning rate for AdamW."
})
weight_decay
:
float
=
field
(
default
=
0.0
,
metadata
=
{
"help"
:
"Weight decay for AdamW if we apply some."
})
weight_decay
:
float
=
field
(
default
=
0.0
,
metadata
=
{
"help"
:
"Weight decay for AdamW if we apply some."
})
...
...
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