mirror of
https://github.com/explosion/spaCy.git
synced 2025-03-13 07:55:49 +03:00
parent
cd6bd91c3a
commit
04239e94c7
|
@ -324,7 +324,8 @@ cdef class TrainablePipe(Pipe):
|
||||||
|
|
||||||
def load_model(p):
|
def load_model(p):
|
||||||
try:
|
try:
|
||||||
self.model.from_bytes(p.open("rb").read())
|
with open(p, "rb") as mfile:
|
||||||
|
self.model.from_bytes(mfile.read())
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
raise ValueError(Errors.E149) from None
|
raise ValueError(Errors.E149) from None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user