From c1c3dba4cb8046b1728b24b3f4613e8214548439 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 25 Jan 2015 18:16:48 +1100 Subject: [PATCH] * Check whether vector files are present before trying to load them. --- spacy/vocab.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/vocab.pyx b/spacy/vocab.pyx index 8eb38b7ca..eb1968688 100644 --- a/spacy/vocab.pyx +++ b/spacy/vocab.pyx @@ -43,7 +43,8 @@ cdef class Vocab: raise IOError("Path %s is a file, not a dir -- cannot load Vocab." % data_dir) self.strings.load(path.join(data_dir, 'strings.txt')) self.load_lexemes(path.join(data_dir, 'lexemes.bin')) - self.load_rep_vectors(path.join(data_dir, 'vec.bin')) + if path.exists(path.join(data_dir, 'vec.bin')): + self.load_rep_vectors(path.join(data_dir, 'vec.bin')) def __len__(self): """The current number of lexemes stored."""