Move task import in MultilingualTransformer to fix circular dependencies
Summary: Pull Request resolved:
@@ -20,7 +20,6 @@ from fairseq.models.transformer import (
TransformerEncoder,
TransformerDecoder,
)
-from fairseq.tasks.multilingual_translation import MultilingualTranslationTask
@register_model('multilingual_transformer')
@@ -59,6 +58,7 @@ class MultilingualTransformerModel(FairseqMultiModel):
@classmethod
def build_model(cls, args, task):
"""Build a new model instance."""
+ from fairseq.tasks.multilingual_translation import MultilingualTranslationTask
assert isinstance(task, MultilingualTranslationTask)
# make sure all arguments are present in older models
