diff --git a/spacy/language.py b/spacy/language.py index 5544b6341..869fa09a7 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -608,6 +608,7 @@ class Language(object): link_vectors_to_models(self.vocab) if self.vocab.vectors.data.shape[1]: cfg["pretrained_vectors"] = self.vocab.vectors.name + cfg['pretrained_dims'] = self.vocab.vectors.data.shape[1] if sgd is None: sgd = create_default_optimizer(Model.ops) self._optimizer = sgd diff --git a/spacy/pipeline/pipes.pyx b/spacy/pipeline/pipes.pyx index b4fecf5cb..3b190debe 100644 --- a/spacy/pipeline/pipes.pyx +++ b/spacy/pipeline/pipes.pyx @@ -1044,6 +1044,7 @@ class TextCategorizer(Pipe): self.add_label(cat) if self.model is True: self.cfg["pretrained_vectors"] = kwargs.get("pretrained_vectors") + self.cfg["pretrained_dims"] = kwargs.get("pretrained_dims") self.require_labels() self.model = self.Model(len(self.labels), **self.cfg) link_vectors_to_models(self.vocab)