mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +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 = []
|
||||
for name, component in nlp.pipeline:
|
||||
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)
|
||||
return loaded
|
||||
|
||||
|
|
|
@ -126,6 +126,10 @@ cdef class Parser:
|
|||
|
||||
def __reduce__(self):
|
||||
return (Parser, (self.vocab, self.moves, self.model), None, None)
|
||||
|
||||
@property
|
||||
def tok2vec(self):
|
||||
return self.model.tok2vec
|
||||
|
||||
@property
|
||||
def move_names(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user