fairseq icon indicating copy to clipboard operation
fairseq copied to clipboard

mBART model code for translation encounters errors.

Open HenningBuhl opened this issue 2 years ago • 1 comments

🐛 Bug

The code for the mBART50 model seems to contain some bugs.

The file 'hub_utils.py' contains a 'translate' function. It encounters an error: TypeError: TranslationMultiSimpleEpochTask.build_generator() got an unexpected keyword argument 'prefix_allowed_tokens_fn' on line 192 in the file 'fairseq/hub_utils.py.

After commenting this line, the next error is: KeyError: None on line 460 in the file 'fairseq/data/multilingual/multilingual_data_manager.py'.

Then I tried setting the target_lang by executing the command 'bart.task.args.target_lang = "fr_XX"' before calling the translate function. This leads to a translation but then the translate function exhibits weird behaviour and the target language cannot be changed again.

HenningBuhl avatar May 29 '23 14:05 HenningBuhl

hi @HenningBuhl did you find solution to this?

nikhiljaiswal avatar Oct 04 '23 16:10 nikhiljaiswal