mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 18:26:30 +03:00
avoid resolving the full config (#6465)
This commit is contained in:
parent
9beba7164f
commit
079f6ea474
|
@ -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 ..ml.models.multi_task import build_cloze_characters_multi_task_model
|
||||||
from ..schemas import ConfigSchemaTraining, ConfigSchemaPretrain
|
from ..schemas import ConfigSchemaTraining, ConfigSchemaPretrain
|
||||||
from ..errors import Errors
|
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(
|
def pretrain(
|
||||||
|
@ -38,7 +38,8 @@ def pretrain(
|
||||||
_config = nlp.config.interpolate()
|
_config = nlp.config.interpolate()
|
||||||
T = registry.resolve(_config["training"], schema=ConfigSchemaTraining)
|
T = registry.resolve(_config["training"], schema=ConfigSchemaTraining)
|
||||||
P = registry.resolve(_config["pretraining"], schema=ConfigSchemaPretrain)
|
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"]
|
batcher = P["batcher"]
|
||||||
model = create_pretraining_model(nlp, P)
|
model = create_pretraining_model(nlp, P)
|
||||||
optimizer = P["optimizer"]
|
optimizer = P["optimizer"]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user