Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
24db8cc3
Unverified
Commit
24db8cc3
authored
Feb 07, 2021
by
Stas Bekman
Committed by
GitHub
Feb 07, 2021
Browse files
Can't mix --fp16 and --device cpu (#10041)
parent
769948fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
examples/seq2seq/run_eval.py
examples/seq2seq/run_eval.py
+6
-0
No files found.
examples/seq2seq/run_eval.py
View file @
24db8cc3
...
...
@@ -132,8 +132,14 @@ def run_generate(verbose=True):
if
args
.
n_obs
>
0
:
examples
=
examples
[:
args
.
n_obs
]
Path
(
args
.
save_path
).
parent
.
mkdir
(
exist_ok
=
True
)
if
args
.
reference_path
is
None
and
Path
(
args
.
score_path
).
exists
():
warnings
.
warn
(
f
"score_path
{
args
.
score_path
}
will be overwritten unless you type ctrl-c."
)
if
args
.
device
==
"cpu"
and
args
.
fp16
:
# this mix leads to RuntimeError: "threshold_cpu" not implemented for 'Half'
raise
ValueError
(
"Can't mix --fp16 and --device cpu"
)
runtime_metrics
=
generate_summaries_or_translations
(
examples
,
args
.
save_path
,
...
...
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