Only load vocab if it exists

This commit is contained in:
ines 2017-06-01 14:38:35 +02:00
parent b577ed79ee
commit a3e4f91f4a
1 changed files with 4 additions and 1 deletions

View File

@ -421,7 +421,10 @@ class Language(object):
if not hasattr(proc, 'to_disk'): if not hasattr(proc, 'to_disk'):
continue continue
deserializers[proc.name] = lambda p, proc=proc: proc.from_disk(p, vocab=False) deserializers[proc.name] = lambda p, proc=proc: proc.from_disk(p, vocab=False)
util.from_disk(path, deserializers, {p: False for p in disable}) exclude = {p: False for p in disable}
if not (path / 'vocab').exists():
exclude['vocab'] = True
util.from_disk(path, deserializers, exclude)
return self return self
def to_bytes(self, disable=[]): def to_bytes(self, disable=[]):