Fix deserialization of vectors

This commit is contained in:
Matthew Honnibal 2017-10-16 20:55:00 +02:00
parent 4cfe259266
commit df488274b1
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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