Unverified Commit 24db8cc3 authored by Stas Bekman's avatar Stas Bekman Committed by GitHub
Browse files

Can't mix --fp16 and --device cpu (#10041)

parent 769948fa
...@@ -132,8 +132,14 @@ def run_generate(verbose=True): ...@@ -132,8 +132,14 @@ def run_generate(verbose=True):
if args.n_obs > 0: if args.n_obs > 0:
examples = examples[: args.n_obs] examples = examples[: args.n_obs]
Path(args.save_path).parent.mkdir(exist_ok=True) Path(args.save_path).parent.mkdir(exist_ok=True)
if args.reference_path is None and Path(args.score_path).exists(): 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.") 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( runtime_metrics = generate_summaries_or_translations(
examples, examples,
args.save_path, args.save_path,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment