Fix multitask objective when no pipeline provided

This commit is contained in:
Matthew Honnibal 2018-02-15 23:50:21 +01:00
parent 59b7cf9db8
commit 7d5c720fc3
1 changed files with 2 additions and 1 deletions

View File

@ -835,7 +835,8 @@ cdef class Parser:
sgd = self.create_optimizer()
self.model[1].begin_training(
self.model[1].ops.allocate((5, cfg['token_vector_width'])))
self.init_multitask_objectives(gold_tuples, pipeline, sgd=sgd, **cfg)
if pipeline is not None:
self.init_multitask_objectives(gold_tuples, pipeline, sgd=sgd, **cfg)
link_vectors_to_models(self.vocab)
else:
if sgd is None: