From a3e4f91f4abae1564a5c9cec15a8904c5d7242a8 Mon Sep 17 00:00:00 2001 From: ines Date: Thu, 1 Jun 2017 14:38:35 +0200 Subject: [PATCH] Only load vocab if it exists --- spacy/language.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index 324d78622..394919dcf 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -421,7 +421,10 @@ class Language(object): if not hasattr(proc, 'to_disk'): continue 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 def to_bytes(self, disable=[]):