# Summarization - Pegasus - min\_length

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsummarization-pegasus-min-length%2F1947%3E%5C
**Category:** Beginners\
**Created:** [November 9, 2020, 11:05am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsummarization-pegasus-min-length%2F1947 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fxchochu)%5C
**Post date:** [November 9, 2020, 11:05am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsummarization-pegasus-min-length%2F1947%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Frgwatwormhill)%5C
**Post date:** [November 10, 2020, 11:54am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsummarization-pegasus-min-length%2F1947%2F2 "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”
