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
e6e5f192
"vscode:/vscode.git/clone" did not exist on "e52741f60117acea1ab113db5e3b4e4245dd0d45"
Commit
e6e5f192
authored
Jun 18, 2019
by
thomwolf
Browse files
fix
parent
a432b3d4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
examples/run_squad.py
examples/run_squad.py
+3
-3
No files found.
examples/run_squad.py
View file @
e6e5f192
...
...
@@ -201,7 +201,7 @@ def main():
if
args
.
do_train
:
if
args
.
local_rank
in
[
-
1
,
0
]:
writer
=
SummaryWriter
()
tb_
writer
=
SummaryWriter
()
# Prepare data loader
train_examples
=
read_squad_examples
(
input_file
=
args
.
train_file
,
is_training
=
True
,
version_2_with_negative
=
args
.
version_2_with_negative
)
...
...
@@ -302,8 +302,8 @@ def main():
loss
.
backward
()
if
(
step
+
1
)
%
args
.
gradient_accumulation_steps
==
0
:
if
args
.
local_rank
in
[
-
1
,
0
]:
writer
.
add_scalar
(
'lr'
,
optimizer
.
get_lr
()[
0
],
global_step
)
writer
.
add_scalar
(
'loss'
,
loss
.
item
(),
global_step
)
tb_
writer
.
add_scalar
(
'lr'
,
optimizer
.
get_lr
()[
0
],
global_step
)
tb_
writer
.
add_scalar
(
'loss'
,
loss
.
item
(),
global_step
)
if
args
.
fp16
:
# modify learning rate with special warm up BERT uses
# if args.fp16 is False, BertAdam is used and handles this automatically
...
...
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