diff --git a/spacy/cli/train.py b/spacy/cli/train.py index ccd404db3..01aebfae8 100644 --- a/spacy/cli/train.py +++ b/spacy/cli/train.py @@ -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 diff --git a/spacy/syntax/nn_parser.pyx b/spacy/syntax/nn_parser.pyx index 25cab43f8..f421520ce 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -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):