Fairseq: TypeError: diverse_beam_strength

Created on 4 Mar 2020  路  2Comments  路  Source: pytorch/fairseq

馃悰 Bug

diverse_beam_strength is a tuple, but does not currently support tuples.
Are you expanding diverse beam search? Or is it wrong to be a tuple?

https://github.com/pytorch/fairseq/blob/3335de5f441ee1b3824e16dcd98db620e40beaba/fairseq/tasks/fairseq_task.py#L247

https://github.com/pytorch/fairseq/blob/244835d811c2c66b1de2c5e86532bac41b154c1a/fairseq/search.py#L114

Environment

  • fairseq Version (master):
bug

Most helpful comment

I removed the brackets and the comma, and it seemed to work.
diverse_beam_strength = (getattr(args, "diverse_beam_strength", 0.5),)
==>
diverse_beam_strength = getattr(args, "diverse_beam_strength", 0.5)

All 2 comments

I removed the brackets and the comma, and it seemed to work.
diverse_beam_strength = (getattr(args, "diverse_beam_strength", 0.5),)
==>
diverse_beam_strength = getattr(args, "diverse_beam_strength", 0.5)

Yes, this was a bug introduced in fab2e86e51f48301146a37fc86d01fdbf5e8a5f2. @Nickeilf's fix is correct, I'll submit a PR for it shortly.

Was this page helpful?
0 / 5 - 0 ratings