# Using Trainer with do\_train + do\_eval

**URL:** <https://discuss.huggingface.co/t/using-trainer-with-do-train-do-eval/1145>\
**Category:** Beginners\
**Created:** [September 15, 2020, 3:20pm UTC](https://discuss.huggingface.co/t/using-trainer-with-do-train-do-eval/1145 "2020-09-15T15:20:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![workingonit](https://avatars.discourse-cdn.com/v4/letter/w/5fc32e/32.png) [@workingonit](https://discuss.huggingface.co/u/workingonit)\
**Post date:** [September 15, 2020, 3:20pm UTC](https://discuss.huggingface.co/t/using-trainer-with-do-train-do-eval/1145/1 "2020-09-15T15:20:47Z")

</div>

Hi, I’m currently training a T5 model using the HF Trainer and looking through the TrainingArguments documentation as well as example scripts.

At the moment I am trying to understand the use of the the two optional arguments within TrainingArguments ‘do\_train’ and ‘do\_eval’. Some examples notebooks don’t specify these, and therefore default these to false.

From experimenting, you can run trainer.evaluate() without ‘do\_eval’, and I can’t figure out what ‘do\_train’ would do if it defaults to False

Thanks,

---

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](https://discuss.huggingface.co/u/sgugger)\
**Post date:** [September 16, 2020, 5:24pm UTC](https://discuss.huggingface.co/t/using-trainer-with-do-train-do-eval/1145/2 "2020-09-16T17:24:27Z")

</div>

Those arguments are only used by the scripts, not the `Trainer` itself.

---

<div class="post-metadata">

**Author:** ![denis-kazakov](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/denis-kazakov/32/28314_2.png) [@denis-kazakov](https://discuss.huggingface.co/u/denis-kazakov)\
**Post date:** [June 20, 2024, 3:51pm UTC](https://discuss.huggingface.co/t/using-trainer-with-do-train-do-eval/1145/3 "2024-06-20T15:51:02Z")

</div>

Hi!  
Which scripts? I also was unable to understand it from examples. The link in the function description does not point to a specific example.
