# How to pass \`min\_length\` parameter in generate?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-pass-min-length-parameter-in-generate%2F56795%3E%5C
**Category:** 🤗Transformers\
**Created:** [September 29, 2023, 7:52am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-pass-min-length-parameter-in-generate%2F56795 "2023-09-29T07:52:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adapting](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/adapting/32/19918_2.png) [@Adapting](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAdapting)%5C
**Post date:** [September 29, 2023, 7:52am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-pass-min-length-parameter-in-generate%2F56795%2F1 "2023-09-29T07:52:11Z")

</div>

Hi!

I was trying to inference my trained model using the inference API, but I need to pass the `min_length` parameter as I inference the model locally:

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/2/d/2d3654f24669e8097823a1299bacef806cf2c748.png)

But when I try to use the inference API, I cannot find that parameter for text2text generation: [Detailed parameters](https://huggingface.co/docs/api-inference/detailed_parameters)

---

<div class="post-metadata">

**Author:** ![Adapting](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/adapting/32/19918_2.png) [@Adapting](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAdapting)%5C
**Post date:** [September 29, 2023, 7:53am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-pass-min-length-parameter-in-generate%2F56795%2F2 "2023-09-29T07:53:10Z")

</div>

I also tried to passed it in the `parameters` argument but it didn’t work:

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/5/4/54020fe540dd056b8555e034129fd2ef8a6267c3.png)

Could anyone please help me? Thanks!
