bug fix: use cls.load_dictionary for multilingual translation
Summary:
Currently, multilingual translation imports Dictionary and calls its load function.
However, this does not permit extending the class with a different load_dictionary function to modify its behavior.
@@ -138,7 +138,7 @@ class MultilingualTranslationTask(FairseqTask):
for lang in sorted_langs:
paths = utils.split_paths(args.data)
assert len(paths) > 0
- dicts[lang] = Dictionary.load(os.path.join(paths[0], 'dict.{}.txt'.format(lang)))
+ dicts[lang] = cls.load_dictionary(os.path.join(paths[0], 'dict.{}.txt'.format(lang)))
if len(dicts) > 0:
assert dicts[lang].pad() == dicts[sorted_langs[0]].pad()
assert dicts[lang].eos() == dicts[sorted_langs[0]].eos()
