      if use_gpu >= 0 and config["system"].get("use_pytorch_for_gpu_memory"):
          use_pytorch_for_gpu_memory()
      nlp, config = util.load_model_from_config(config)
      P_cfg = config["pretraining"]
      corpus = P_cfg["corpus"]
      batcher = P_cfg["batcher"]
      model = create_pretraining_model(nlp, config["pretraining"])
      optimizer = config["pretraining"]["optimizer"]
  
      # Load in pretrained weights to resume from
 
</s> remove     corpus: Reader = Field(..., title="Reader for the training data")
 </s> add     corpus: StrictStr = Field(..., title="Path in the config to the training data") </s> remove     config["training"]["corpus"]["@readers"] = reader
    config["training"]["corpus"].update(additional_config)
 </s> add     config["corpora"]["@readers"] = reader
    config["corpora"].update(additional_config) </s> remove     corpus: Dict[str, Reader] = Field(..., title="Reader for the training and dev data")
 </s> add     dev_corpus: StrictStr = Field(..., title="Path in the config to the dev data")
    train_corpus: StrictStr = Field(..., title="Path in the config to the training data") </s> remove from spacy.util import load_model_from_config
 </s> add from spacy import Language
from spacy.util import load_model_from_config, registry, dot_to_object
from spacy.training import Example


def test_readers():
    config_string = """
    [training]
    
    [corpora]
    @readers = "myreader.v1"

    [nlp]
    lang = "en"
    pipeline = ["tok2vec", "textcat"]
    
    [components]
    
    [components.tok2vec]
    factory = "tok2vec"
    
    [components.textcat]
    factory = "textcat"
    """
    @registry.readers.register("myreader.v1")
    def myreader() -> Dict[str, Callable[[Language, str], Iterable[Example]]]:
        annots = {"cats": {"POS": 1.0, "NEG": 0.0}}
        def reader(nlp: Language):
            doc = nlp.make_doc(f"This is an example")
            return [Example.from_dict(doc, annots)]
        return {"train": reader, "dev": reader, "extra": reader, "something": reader}

    config = Config().from_str(config_string)
    nlp, resolved = load_model_from_config(config, auto_fill=True)

    train_corpus = dot_to_object(resolved, resolved["training"]["train_corpus"])
    assert isinstance(train_corpus, Callable)
    optimizer = resolved["training"]["optimizer"]
    # simulate a training loop
    nlp.begin_training(lambda: train_corpus(nlp), sgd=optimizer)
    for example in train_corpus(nlp):
        nlp.update([example], sgd=optimizer)
    dev_corpus = dot_to_object(resolved, resolved["training"]["dev_corpus"])
    scores = nlp.evaluate(list(dev_corpus(nlp)))
    assert scores["cats_score"]
    # ensure the pipeline runs
    doc = nlp("Quick test")
    assert doc.cats
    extra_corpus = resolved["corpora"]["extra"]
    assert isinstance(extra_corpus, Callable) </s> remove [training.corpus.dev]
 </s> add [corpora.dev]
    corpus = dot_to_object(config, config["pretraining"]["corpus"])
      if use_gpu >= 0 and config["system"].get("use_pytorch_for_gpu_memory"):
          use_pytorch_for_gpu_memory()
      nlp, config = util.load_model_from_config(config)
      P_cfg = config["pretraining"]
    corpus = dot_to_object(config, config["pretraining"]["corpus"])
      batcher = P_cfg["batcher"]
      model = create_pretraining_model(nlp, config["pretraining"])
      optimizer = config["pretraining"]["optimizer"]
  
      # Load in pretrained weights to resume from
keep keep keep keep replace keep keep keep keep keep
 generalize corpora, dot notation for dev and train corpus 
spacy/cli/pretrain.py