mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
Fix deserialization of vectors
This commit is contained in:
parent
4cfe259266
commit
df488274b1
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user