From 312d7b46ae4358b91783dc04750ebd744501f985 Mon Sep 17 00:00:00 2001 From: Steele Farnsworth <32915757+swfarnsworth@users.noreply.github.com> Date: Fri, 23 Apr 2021 14:33:46 -0400 Subject: [PATCH] Set `cuda_device` to `-1` by default. Ensures that the CPU is used by default. --- medacy/pipelines/lstm_systematic_review_pipeline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/medacy/pipelines/lstm_systematic_review_pipeline.py b/medacy/pipelines/lstm_systematic_review_pipeline.py index cfd1963c..38769352 100644 --- a/medacy/pipelines/lstm_systematic_review_pipeline.py +++ b/medacy/pipelines/lstm_systematic_review_pipeline.py @@ -36,7 +36,7 @@ def __init__(self, entities, metamap=None, **kwargs): raise ValueError('This pipeline requires word embeddings.') self.word_embeddings = kwargs['word_embeddings'] - self.cuda_device = kwargs['cuda_device'] + self.cuda_device = kwargs.get('cuda_device', -1) def get_learner(self): learner = BiLstmCrfLearner(self.word_embeddings, self.cuda_device)