From 8716ffe57d71cd0cd8d1e34b0417006e588ae478 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 24 Sep 2017 05:01:45 -0500 Subject: [PATCH] Serialize vocab last --- spacy/language.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index edf0a4b5c..502430368 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -491,7 +491,6 @@ class Language(object): """ path = util.ensure_path(path) serializers = OrderedDict(( - ('vocab', lambda p: self.vocab.to_disk(p)), ('tokenizer', lambda p: self.tokenizer.to_disk(p, vocab=False)), ('meta.json', lambda p: p.open('w').write(json_dumps(self.meta))) )) @@ -503,6 +502,7 @@ class Language(object): if not hasattr(proc, 'to_disk'): continue serializers[proc.name] = lambda p, proc=proc: proc.to_disk(p, vocab=False) + serializers['vocab'] = lambda p: self.vocab.to_disk(p) util.to_disk(path, serializers, {p: False for p in disable}) def from_disk(self, path, disable=tuple()):