From 60eb2343ced0e2b1055a6662811576beb3e64b81 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 23 Nov 2016 13:50:24 +0100 Subject: [PATCH] Only try to load vectors if they exist. --- spacy/language.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index d35d78456..3a2e6afbf 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -57,7 +57,8 @@ class BaseDefaults(object): return False else: vec_path = nlp.path / 'vocab' / 'vec.bin' - return lambda vocab: vocab.load_vectors_from_bin_loc(vec_path) + if vec_path.exists(): + return lambda vocab: vocab.load_vectors_from_bin_loc(vec_path) @classmethod def create_tokenizer(cls, nlp=None):