Hello, I want to get several promising generative candidates using the diverse beam-search decoding.
But when I execute the code as follows, they all produce the same sentence.
sample_outputs = self.model.generate(
input_ids = input_ids,
max_length = args.max_input_length,
num_beams = 6,
num_beam_groups = 3,
num_return_sequences = 3,
pad_token_id = self.tokenizer.pad_token_id,
eos_token_id = self.tokenizer.eos_token_id,
)
If num_return_sequences
is set to be the same as num_beam_groups
, won’t each group’s sentence be printed one by one?
However, all num_return_sequences
sentences returned are the same.
I checked that deleting num_beam_groups
returns different sentence candidates well.
I would appreciate it if you could tell me which variable I should add to use the diverse beam-search decoding.
Thanks.