# How to set generate parameters in fine-tuning

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-set-generate-parameters-in-fine-tuning%2F26542%3E%5C
**Category:** 🤗Transformers\
**Created:** [November 22, 2022, 9:33pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-set-generate-parameters-in-fine-tuning%2F26542 "2022-11-22T21:33:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstimson](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@cstimson](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fcstimson)%5C
**Post date:** [November 22, 2022, 9:33pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-set-generate-parameters-in-fine-tuning%2F26542%2F1 "2022-11-22T21:33:24Z")

</div>

I’m working with the Helsinki-NLP/opus-mt-en-es model for translation. I found that when generating sequences, it was helpful to set the `repetition_penalty` parameter. Now I want to fine tune the model with my own data and I would like to include a `repetition_penalty`. But I can’t see where to set this parameter in the Trainer API (Seq2SeqTrainer). Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![ShadyPi](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@ShadyPi](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FShadyPi)%5C
**Post date:** [October 12, 2023, 9:33am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-set-generate-parameters-in-fine-tuning%2F26542%2F2 "2023-10-12T09:33:23Z")

</div>

I also encounter a similar question when I want to evaluate the fine-tuned model, the model only generates 20 new tokens, but I want it to generate 256. Do you find some possible solutions?
