avoid resolving the full config (#6465)

This commit is contained in:
Sofie Van Landeghem 2020-11-30 02:34:29 +01:00 committed by GitHub
parent 9beba7164f
commit 079f6ea474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"]