# Parameters for evaluation loop of a Seq2SeqTrainer model

**URL:** <https://discuss.huggingface.co/t/parameters-for-evaluation-loop-of-a-seq2seqtrainer-model/12305>\
**Category:** Intermediate\
**Created:** [November 26, 2021, 1:20pm UTC](https://discuss.huggingface.co/t/parameters-for-evaluation-loop-of-a-seq2seqtrainer-model/12305 "2021-11-26T13:20:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marshmellow77](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/marshmellow77/32/3279_2.png) [@marshmellow77](https://discuss.huggingface.co/u/marshmellow77)\
**Post date:** [November 26, 2021, 1:20pm UTC](https://discuss.huggingface.co/t/parameters-for-evaluation-loop-of-a-seq2seqtrainer-model/12305/1 "2021-11-26T13:20:12Z")

</div>

Hi all, I’m training a summarization model with the Seq2SeqTrainer API. Once the model is trained I would like to generate summaries with specific values for `top_k, top_n, temperature`, etc.

The `evaluate()` method only allows for certain parameters to be passed on to the `generate()` method, namely `max_length` and `num_beams`, see here: [transformers/trainer\_seq2seq.py at master · huggingface/transformers · GitHub](https://github.com/huggingface/transformers/blob/master/src/transformers/trainer_seq2seq.py#L36)

I’m wondering whether this leads to a model that doesn’t perform well at the target task? I’m imagining that the model will be optimised for certain values of `top_k, top_n, temperature` which won’t be the same as the ones I would like to use.

(1) Is this a valid concern or am I overthinking this?  
(2) If it is a valid concern → If I wanted to change the values for those parameters, how would I go about it? Would I have to change the configuration of the model before training, since the `generate()` function reads the values for these parameters from there (see [transformers/generation\_utils.py at c4d4e8bdbd25d9463d41de6398940329c89b7fb6 · huggingface/transformers · GitHub](https://github.com/huggingface/transformers/blob/c4d4e8bdbd25d9463d41de6398940329c89b7fb6/src/transformers/generation_utils.py#L101))?

Any insights appreciated 🤗

Cheers,  
Heiko
