# Batch\_decode does not give the correct output as generate

**URL:** <https://discuss.huggingface.co/t/batch-decode-does-not-give-the-correct-output-as-generate/15811>\
**Category:** 🤗Transformers\
**Created:** [March 17, 2022, 4:27pm UTC](https://discuss.huggingface.co/t/batch-decode-does-not-give-the-correct-output-as-generate/15811 "2022-03-17T16:27:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LearnToGrow](https://avatars.discourse-cdn.com/v4/letter/l/5fc32e/32.png) [@LearnToGrow](https://discuss.huggingface.co/u/LearnToGrow)\
**Post date:** [March 17, 2022, 4:27pm UTC](https://discuss.huggingface.co/t/batch-decode-does-not-give-the-correct-output-as-generate/15811/1 "2022-03-17T16:27:33Z")

</div>

In this script: `https://github.com/rafikg/transformers/blob/master/examples/pytorch/summarization/run_summarization.py`

In the line `662`, I added `num_return_sequences=2` param of `generate()` method but the model is still returning only one sequence instead of 2! I want to add `no_repeat_ngram_size=2`, `early stopping=True`, etc like in

```auto
generate(tokenized_input.input_ids,
                max_length=64,
                no_repeat_ngram_size=2,
                early_stopping=True,
                num_beams=4,
               num_return_sequences=2)

```

How we can fix it ?
