# Summarization - Pegasus - min\_length

**URL:** <https://discuss.huggingface.co/t/summarization-pegasus-min-length/1947>\
**Category:** Beginners\
**Created:** [November 9, 2020, 11:05am UTC](https://discuss.huggingface.co/t/summarization-pegasus-min-length/1947 "2020-11-09T11:05:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xchochu](https://avatars.discourse-cdn.com/v4/letter/x/edb3f5/32.png) [@xchochu](https://discuss.huggingface.co/u/xchochu)\
**Post date:** [November 9, 2020, 11:05am UTC](https://discuss.huggingface.co/t/summarization-pegasus-min-length/1947/1 "2020-11-09T11:05:01Z")

</div>

Hello.

I am playing around with the minimal number of tokens in the generated output by “google/pegasus-cnn\_dailymail”. Basically I follow the documentation so my code looks like this

```
    batch = tokPeg.prepare_seq2seq_batch(src_texts=[s]).to(torch_device) 
    gen = modelPeg.generate(**batch, 
                        num_beams=int(8), min_lenght=100)
    summary: List[str] = tokPeg.batch_decode(gen, skip_special_tokens=True)

```

However, when I count number of tokens in output text by `len(tokPeg.tokenize(summary[0]))` the output text produces fewer tokens than is specified in min\_length. Is there anything I am missing?

---

<div class="post-metadata">

**Author:** ![rgwatwormhill](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rgwatwormhill](https://discuss.huggingface.co/u/rgwatwormhill)\
**Post date:** [November 10, 2020, 11:54am UTC](https://discuss.huggingface.co/t/summarization-pegasus-min-length/1947/2 "2020-11-10T11:54:37Z")

</div>

this might be a red herring, but your code snippet shows “min\_lenght” where it should be “min\_length”
