fairseq icon indicating copy to clipboard operation
fairseq copied to clipboard

Preserve order when using skip_invalid_size_inputs

Open AbdallahNasir opened this issue 1 year ago • 2 comments

What does this PR do?

When translating using a model from hub_utils in the production setting, if skip_invalid_size_inputs is set to True, then the output list of translations may be different in length from the input list of strings.

These changes enforce empty responses in case of failure instead of no responses which will lead to mismatching the input sentences from the hyp outputs when using batching.

AbdallahNasir avatar Apr 17 '23 12:04 AbdallahNasir

This is a massively helpful PR. I routinely have to re-align my source with my generated output which can be very messy. This is a very easy PR to accept.

erip avatar May 17 '23 12:05 erip

Thanks @erip ! Would appreciate if someone from the team can look into it.

AbdallahNasir avatar Jun 08 '23 12:06 AbdallahNasir