# Pegasus Summarization API\_Inference

**URL:** <https://discuss.huggingface.co/t/pegasus-summarization-api-inference/5974>\
**Category:** Beginners\
**Created:** [May 4, 2021, 10:52am UTC](https://discuss.huggingface.co/t/pegasus-summarization-api-inference/5974 "2021-05-04T10:52:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![induveca](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@induveca](https://discuss.huggingface.co/u/induveca)\
**Post date:** [May 4, 2021, 10:52am UTC](https://discuss.huggingface.co/t/pegasus-summarization-api-inference/5974/1 "2021-05-04T10:52:40Z")

</div>

Loving this model, and if we can use the API we’re happy to do so. Using Pegasus summarization for some testing.

[human-centered-summarization/financial-summarization-pegasus · Hugging Face](https://huggingface.co/human-centered-summarization/financial-summarization-pegasus)

However, there seem to be no options to pass via POST to determine a minimum and maximum length, which renders this endpoint useless.

Am I missing something here? Thanks, happy to be a new subscriber.

---

<div class="post-metadata">

**Author:** ![Narsil](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/narsil/32/40029_2.png) [@Narsil](https://discuss.huggingface.co/u/Narsil)\
**Post date:** [May 4, 2021, 3:51pm UTC](https://discuss.huggingface.co/t/pegasus-summarization-api-inference/5974/2 "2021-05-04T15:51:13Z")

</div>

Hi @induveca ,

Why would you say the endpoint is useless without being able to specify `min_length` and `max_length` ? Models are conditioned to summarize, so the output should work.

Anyway, you can still specify `min_length` and `max_length` even if these arguments are not documented (they are not documented which means behavior is subject to change in the future). They are specified in tokens length, which is really hard to gauge if you are only handling text.

If you are using those, expect that the output might be cut mid sentence as you are basically forcing the model to stop outputting tokens even if it had still tokens to say.

Cheers,  
Nicolas

---

<div class="post-metadata">

**Author:** ![induveca](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@induveca](https://discuss.huggingface.co/u/induveca)\
**Post date:** [May 4, 2021, 4:43pm UTC](https://discuss.huggingface.co/t/pegasus-summarization-api-inference/5974/3 "2021-05-04T16:43:25Z")

</div>

It has a maximum length of 32 tokens for a financial model. When inputting an earnings call that will never be enough.

So it is useless for any financial document without that ability to tweak.

Are there other parameters we can use other than min\_length and max\_length? Thanks for the help.

---

<div class="post-metadata">

**Author:** ![induveca](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@induveca](https://discuss.huggingface.co/u/induveca)\
**Post date:** [May 5, 2021, 1:18pm UTC](https://discuss.huggingface.co/t/pegasus-summarization-api-inference/5974/4 "2021-05-05T13:18:10Z")

</div>

Any ideas here? I can just download and host it myself, but I do love the api-inference. Not seeing any parameter options on the api-inference demo. Assume this is a mistake, as it’s your profit driver and happy to pay/upgrade to a much larger plan if I can get it working correctly via api-inference. 🙂 Thanks much for the awesome resource/community.

---

<div class="post-metadata">

**Author:** ![dsno800](https://avatars.discourse-cdn.com/v4/letter/d/eb8c5e/32.png) [@dsno800](https://discuss.huggingface.co/u/dsno800)\
**Post date:** [May 28, 2021, 9:45am UTC](https://discuss.huggingface.co/t/pegasus-summarization-api-inference/5974/5 "2021-05-28T09:45:34Z")

</div>

@induveca ave you been able to solve this?
