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
5bfcd048
"test/git@developer.sourcefind.cn:hehl2/torchaudio.git" did not exist on "20469cfe01f90c0b7312f4537b4318af3de04ebb"
Commit
5bfcd048
authored
Dec 04, 2019
by
thomwolf
Browse files
fix #1991
parent
cae641ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
examples/run_lm_finetuning.py
examples/run_lm_finetuning.py
+4
-1
No files found.
examples/run_lm_finetuning.py
View file @
5bfcd048
...
...
@@ -217,7 +217,10 @@ def train(args, train_dataset, model, tokenizer):
global_step
=
0
tr_loss
,
logging_loss
=
0.0
,
0.0
model
.
resize_token_embeddings
(
len
(
tokenizer
))
model_to_resize
=
model
.
module
if
hasattr
(
model
,
'module'
)
else
model
# Take care of distributed/parallel training
model_to_resize
.
resize_token_embeddings
(
len
(
tokenizer
))
model
.
zero_grad
()
train_iterator
=
trange
(
int
(
args
.
num_train_epochs
),
desc
=
"Epoch"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
set_seed
(
args
)
# Added here for reproducibility (even between python 2 and 3)
...
...
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