From 388e3251fa95b892949968dc89065e464a93b69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20Garc=C3=ADa=20Subies?= <37592763+GuillemGSubies@users.noreply.github.com> Date: Tue, 20 Aug 2019 14:19:39 +0200 Subject: [PATCH] Update tokenization_xlm.py --- pytorch_transformers/tokenization_xlm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_transformers/tokenization_xlm.py b/pytorch_transformers/tokenization_xlm.py index 8e7c2954f2..2d2f3a8cd4 100644 --- a/pytorch_transformers/tokenization_xlm.py +++ b/pytorch_transformers/tokenization_xlm.py @@ -126,7 +126,7 @@ class XLMTokenizer(PreTrainedTokenizer): import ftfy from spacy.lang.en import English _nlp = English() - self.nlp = nlp.Defaults.create_tokenizer(_nlp) + self.nlp = _nlp.Defaults.create_tokenizer(_nlp) self.fix_text = ftfy.fix_text except ImportError: logger.warning("ftfy or spacy is not installed using BERT BasicTokenizer instead of SpaCy & ftfy.")