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