From df488274b17a67c9e81566f2fa03cf896d096dc7 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 16 Oct 2017 20:55:00 +0200 Subject: [PATCH] Fix deserialization of vectors --- spacy/util.py | 2 +- spacy/vectors.pyx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spacy/util.py b/spacy/util.py index 71dff4321..a67b05eb2 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -494,7 +494,7 @@ def from_disk(path, readers, exclude): path = ensure_path(path) for key, reader in readers.items(): if key not in exclude: - reader(path2str(path / key)) + reader(path / key) return path diff --git a/spacy/vectors.pyx b/spacy/vectors.pyx index 8ce150531..5512279ae 100644 --- a/spacy/vectors.pyx +++ b/spacy/vectors.pyx @@ -12,7 +12,7 @@ from thinc.neural._classes.model import Model from .typedefs cimport attr_t from .strings cimport StringStore from . import util -from .compat import basestring_ +from .compat import basestring_, path2str cdef class Vectors: @@ -162,7 +162,7 @@ cdef class Vectors: def from_disk(self, path, **exclude): def load_keys(path): if path.exists(): - self.keys = numpy.load(path) + self.keys = numpy.load(path2str(path)) for i, key in enumerate(self.keys): self.keys[i] = key self.key2row[key] = i