From 453683aaf00956537c3dc11a26389b91ba1fe948 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 24 Sep 2016 20:50:31 +0200 Subject: [PATCH] Fix spacy/vocab.pyx --- spacy/vocab.pyx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spacy/vocab.pyx b/spacy/vocab.pyx index f061dd233..92b05da8c 100644 --- a/spacy/vocab.pyx +++ b/spacy/vocab.pyx @@ -73,7 +73,11 @@ cdef class Vocab: self.load_lexemes(path / 'vocab' / 'lexemes.bin') if vectors is True: - vectors = lambda self_: self_.load_vectors_from_bin_loc(path / 'vocab' / 'vec.bin') + vec_path = path / 'vocab' / 'vec.bin' + if vec_path.exists(): + vectors = lambda self_: self_.load_vectors_from_bin_loc(vec_path) + else: + vectors = lambda self_: 0 if vectors: self.vectors_length = vectors(self) return self