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
e1eab59a
Commit
e1eab59a
authored
Dec 13, 2018
by
thomwolf
Browse files
no fp16 on evaluation
parent
087798b7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
6 deletions
+0
-6
examples/run_classifier.py
examples/run_classifier.py
+0
-2
examples/run_squad.py
examples/run_squad.py
+0
-2
examples/run_swag.py
examples/run_swag.py
+0
-2
No files found.
examples/run_classifier.py
View file @
e1eab59a
...
...
@@ -558,8 +558,6 @@ def main():
# Load a trained model that you have fine-tuned
model_state_dict
=
torch
.
load
(
output_model_file
)
model
=
BertForSequenceClassification
.
from_pretrained
(
args
.
bert_model
,
state_dict
=
model_state_dict
)
if
args
.
fp16
:
model
.
half
()
model
.
to
(
device
)
if
args
.
do_eval
and
(
args
.
local_rank
==
-
1
or
torch
.
distributed
.
get_rank
()
==
0
):
...
...
examples/run_squad.py
View file @
e1eab59a
...
...
@@ -923,8 +923,6 @@ def main():
# Load a trained model that you have fine-tuned
model_state_dict
=
torch
.
load
(
output_model_file
)
model
=
BertForQuestionAnswering
.
from_pretrained
(
args
.
bert_model
,
state_dict
=
model_state_dict
)
if
args
.
fp16
:
model
.
half
()
model
.
to
(
device
)
if
args
.
do_predict
and
(
args
.
local_rank
==
-
1
or
torch
.
distributed
.
get_rank
()
==
0
):
...
...
examples/run_swag.py
View file @
e1eab59a
...
...
@@ -478,8 +478,6 @@ def main():
model
=
BertForMultipleChoice
.
from_pretrained
(
args
.
bert_model
,
state_dict
=
model_state_dict
,
num_choices
=
4
)
if
args
.
fp16
:
model
.
half
()
model
.
to
(
device
)
if
args
.
do_eval
and
(
args
.
local_rank
==
-
1
or
torch
.
distributed
.
get_rank
()
==
0
):
...
...
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