From f4c9a98166feacc788f2d93e834ae2cf3e0332d2 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 6 Oct 2017 13:17:47 -0500 Subject: [PATCH] Fix spacy evaluate command on non-GPU --- spacy/cli/evaluate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/cli/evaluate.py b/spacy/cli/evaluate.py index 42e077dc2..29e30b7d2 100644 --- a/spacy/cli/evaluate.py +++ b/spacy/cli/evaluate.py @@ -42,7 +42,8 @@ def evaluate(cmd, model, data_path, gpu_id=-1, gold_preproc=False, Evaluate a model. To render a sample of parses in a HTML file, set an output directory as the displacy_path argument. """ - util.use_gpu(gpu_id) + if gpu_id >= 0: + util.use_gpu(gpu_id) util.set_env_log(False) data_path = util.ensure_path(data_path) displacy_path = util.ensure_path(displacy_path)