From 5eae3b9a1e421fb81257e73e1848a2d8a953da7a Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 1 Jun 2017 04:55:49 -0500 Subject: [PATCH] Fix to/from disk in tagger --- spacy/pipeline.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spacy/pipeline.pyx b/spacy/pipeline.pyx index 8e75bf292..c1e1f3358 100644 --- a/spacy/pipeline.pyx +++ b/spacy/pipeline.pyx @@ -160,7 +160,7 @@ class TokenVectorEncoder(object): def to_bytes(self, **exclude): serialize = OrderedDict(( - ('model', lambda: util.model_to_bytes(self.model)), + ('model', lambda: self.model.to_bytes()), ('vocab', lambda: self.vocab.to_bytes()) )) return util.to_bytes(serialize, exclude) @@ -177,7 +177,7 @@ class TokenVectorEncoder(object): def to_disk(self, path, **exclude): serialize = OrderedDict(( - ('model', lambda p: p.open('wb').write(util.model_to_bytes(self.model))), + ('model', lambda p: p.open('wb').write(self.model.to_bytes())), ('vocab', lambda p: self.vocab.to_disk(p)) )) util.to_disk(path, serialize, exclude) @@ -298,7 +298,7 @@ class NeuralTagger(object): def to_bytes(self, **exclude): serialize = OrderedDict(( - ('model', lambda: util.model_to_bytes(self.model)), + ('model', lambda: self.model.to_bytes()), ('vocab', lambda: self.vocab.to_bytes()) )) return util.to_bytes(serialize, exclude) @@ -318,7 +318,7 @@ class NeuralTagger(object): def to_disk(self, path, **exclude): serialize = { - 'model': lambda p: p.open('wb').write(util.model_to_bytes(self.model)), + 'model': lambda p: p.open('wb').write(self.model.to_bytes()), 'vocab': lambda p: self.vocab.to_disk(p) } util.to_disk(path, serialize, exclude)