mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-07 13:26:02 +03:00
Fix tok2vec loading in spacy train
This commit is contained in:
parent
2ddd428834
commit
2874b8efd8
|
@ -213,7 +213,7 @@ def _load_pretrained_tok2vec(nlp, loc):
|
||||||
loaded = []
|
loaded = []
|
||||||
for name, component in nlp.pipeline:
|
for name, component in nlp.pipeline:
|
||||||
if hasattr(component, 'model') and hasattr(component.model, 'tok2vec'):
|
if hasattr(component, 'model') and hasattr(component.model, 'tok2vec'):
|
||||||
component.model.tok2vec.from_bytes(weights_data)
|
component.tok2vec.from_bytes(weights_data)
|
||||||
loaded.append(name)
|
loaded.append(name)
|
||||||
return loaded
|
return loaded
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,10 @@ cdef class Parser:
|
||||||
|
|
||||||
def __reduce__(self):
|
def __reduce__(self):
|
||||||
return (Parser, (self.vocab, self.moves, self.model), None, None)
|
return (Parser, (self.vocab, self.moves, self.model), None, None)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def tok2vec(self):
|
||||||
|
return self.model.tok2vec
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def move_names(self):
|
def move_names(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user