mirror of https://github.com/explosion/spaCy.git
Only load vocab if it exists
This commit is contained in:
parent
b577ed79ee
commit
a3e4f91f4a
|
@ -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=[]):
|
||||||
|
|
Loading…
Reference in New Issue