From 079f6ea474bfaf45b2ee126c32c986bb1ba6fba2 Mon Sep 17 00:00:00 2001 From: Sofie Van Landeghem Date: Mon, 30 Nov 2020 02:34:29 +0100 Subject: [PATCH] avoid resolving the full config (#6465) --- spacy/training/pretrain.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacy/training/pretrain.py b/spacy/training/pretrain.py index e5c41c70b..57fbc7781 100644 --- a/spacy/training/pretrain.py +++ b/spacy/training/pretrain.py @@ -17,7 +17,7 @@ from ..ml.models.multi_task import build_cloze_multi_task_model from ..ml.models.multi_task import build_cloze_characters_multi_task_model from ..schemas import ConfigSchemaTraining, ConfigSchemaPretrain from ..errors import Errors -from ..util import registry, load_model_from_config, resolve_dot_names +from ..util import registry, load_model_from_config, dot_to_object def pretrain( @@ -38,7 +38,8 @@ def pretrain( _config = nlp.config.interpolate() T = registry.resolve(_config["training"], schema=ConfigSchemaTraining) P = registry.resolve(_config["pretraining"], schema=ConfigSchemaPretrain) - corpus = resolve_dot_names(_config, [P["corpus"]])[0] + corpus = dot_to_object(_config, P["corpus"]) + corpus = registry.resolve({"corpus": corpus})["corpus"] batcher = P["batcher"] model = create_pretraining_model(nlp, P) optimizer = P["optimizer"]