mirror of https://github.com/explosion/spaCy.git
* Check whether vector files are present before trying to load them.
This commit is contained in:
parent
7a750983b9
commit
c1c3dba4cb
|
@ -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."""
|
||||
|
|
Loading…
Reference in New Issue