          if not isinstance(label, str):
              raise ValueError(Errors.E187)
          if label in self.labels:
              return 0
          if self.model not in (None, True, False):
              # This functionality was available previously, but was broken.
              # The problem is that we resize the last layer, but the last layer
              # is actually just an ensemble. We're not resizing the child layers
              # - a huge problem.
              raise ValueError(Errors.E116)
 
</s> remove         if self.model not in (True, False, None):
 </s> add         if self.model.has_dim("nO"): </s> remove     def require_model(self):
        # Raise an error if the component's model is not initialized.
        if getattr(self, "model", None) in (None, True, False):
            raise ValueError(Errors.E109.format(name=self.name))

 </s> add  </s> remove     @classmethod
    def Model(cls, n_tags=None, **cfg):
        if cfg.get("pretrained_dims") and not cfg.get("pretrained_vectors"):
            raise ValueError(TempErrors.T008)
        if "tok2vec" in cfg:
            tok2vec = cfg["tok2vec"]
        else:
            config = {
                "width": cfg.get("token_vector_width", 96),
                "embed_size": cfg.get("embed_size", 2000),
                "pretrained_vectors": cfg.get("pretrained_vectors", None),
                "window_size": cfg.get("window_size", 1),
                "cnn_maxout_pieces": cfg.get("cnn_maxout_pieces", 3),
                "subword_features": cfg.get("subword_features", True),
                "char_embed": cfg.get("char_embed", False),
                "conv_depth": cfg.get("conv_depth", 4),
                "bilstm_depth": cfg.get("bilstm_depth", 0),
            }
            tok2vec = Tok2Vec(**config)
        return build_tagger_model(n_tags, tok2vec)

 </s> add  </s> remove     def require_model(self):
        """Raise an error if the component's model is not initialized."""
        if getattr(self, "model", None) in (None, True, False):
            raise ValueError(Errors.E109.format(name=self.name))

 </s> add  </s> remove     def require_model(self):
        """Raise an error if the component's model is not initialized."""
        if getattr(self, 'model', None) in (None, True, False):
            raise ValueError(Errors.E109.format(name=self.name))

 </s> add 
        if self.model.has_dim("nO"):
          if not isinstance(label, str):
              raise ValueError(Errors.E187)
          if label in self.labels:
              return 0
        if self.model.has_dim("nO"):
              # This functionality was available previously, but was broken.
              # The problem is that we resize the last layer, but the last layer
              # is actually just an ensemble. We're not resizing the child layers
              # - a huge problem.
              raise ValueError(Errors.E116)
keep keep keep keep replace keep keep keep keep keep
 Default settings to configurations (#4995)

* fix grad_clip naming

* cleaning up pretrained_vectors out of cfg

* further refactoring Model init's

* move Model building out of pipes

* further refactor to require a model config when creating a pipe

* small fixes

* making cfg in nn_parser more consistent

* fixing nr_class for parser

* fixing nn_parser's nO

* fix printing of loss

* architectures in own file per type, consistent naming

* convenience methods default_tagger_config and default_tok2vec_config

* let create_pipe access default config if available for that component

* default_parser_config

* move defaults to separate folder

* allow reading nlp from package or dir with argument 'name'

* architecture spacy.VocabVectors.v1 to read static vectors from file

* cleanup

* default configs for nel, textcat, morphologizer, tensorizer

* fix imports

* fixing unit tests

* fixes and clean up

* fixing defaults, nO, fix unit tests

* restore parser IO

* fix IO

* 'fix' serialization test

* add *.cfg to manifest

* fix example configs with additional arguments

* replace Morpohologizer with Tagger

* add IO bit when testing overfitting of tagger (currently failing)

* fix IO - don't initialize when reading from disk

* expand overfitting tests to also check IO goes OK

* remove dropout from HashEmbed to fix Tagger performance

* add defaults for sentrec

* update thinc

* always pass a Model instance to a Pipe

* fix piped_added statement

* remove obsolete W029

* remove obsolete errors

* restore byte checking tests (work again)

* clean up test

* further test cleanup

* convert from config to Model in create_pipe

* bring back error when component is not initialized

* cleanup

* remove calls for nlp2.begin_training

* use thinc.api in imports

* allow setting charembed's nM and nC

* fix for hardcoded nM/nC + unit test

* formatting fixes

* trigger build 
spacy/pipeline/pipes.pyx