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
745ea78d
Commit
745ea78d
authored
Mar 04, 2021
by
Sylvain Gugger
Browse files
Revert "Not always consider a local model a checkpoint in run_glue"
This reverts commit
f3660613
.
parent
f3660613
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
examples/text-classification/run_glue.py
examples/text-classification/run_glue.py
+3
-6
No files found.
examples/text-classification/run_glue.py
View file @
745ea78d
...
@@ -406,15 +406,12 @@ def main():
...
@@ -406,15 +406,12 @@ def main():
# Training
# Training
if
training_args
.
do_train
:
if
training_args
.
do_train
:
checkpoint
=
None
if
last_checkpoint
is
not
None
:
if
last_checkpoint
is
not
None
:
checkpoint
=
last_checkpoint
checkpoint
=
last_checkpoint
elif
os
.
path
.
isdir
(
model_args
.
model_name_or_path
):
elif
os
.
path
.
isdir
(
model_args
.
model_name_or_path
):
# Check the config from that potential checkpoint has the right number of labels before using it as a
checkpoint
=
model_args
.
model_name_or_path
# checkpoint.
else
:
if
AutoConfig
.
from_pretrained
(
model_args
.
model_name_or_path
).
num_labels
==
num_labels
:
checkpoint
=
None
checkpoint
=
model_args
.
model_name_or_path
train_result
=
trainer
.
train
(
resume_from_checkpoint
=
checkpoint
)
train_result
=
trainer
.
train
(
resume_from_checkpoint
=
checkpoint
)
metrics
=
train_result
.
metrics
metrics
=
train_result
.
metrics
...
...
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