Add possibility to evaluate every epoch
Author: sgugger
Pull request: yes

This PR deprecates the argument `evaluate_during_training` and replaces it by `evaluation_strategy` (which supports more than just two values). The goal is to add support to easily evaluate the model every epoch (currently evaluation is done every n steps).

Evaluating every epoch is the most commonly used evaluation strategy, taught in pretty much every course and done in every basic training loop. While it's possible to do that right now, it require a bit of gymnastic (by building the dataloader and grabbing its length or dividing the number of samples in the dataset by the effective batch size). There have been two issues opened about that (but I'm too lazy to track their numbers ^^).

In passing, I made `eval_steps` default to the same as `logging_steps` because it seemed more natural.




Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/7302?src=pr&el=h1) Report
> Merging [#7302](https://codecov.io/gh/huggingface/transformers/pull/7302?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/34a1b75f01667cc176304d7594245a7c308855df?el=desc) will **decrease** coverage by `1.08%`.
> The diff coverage is `85.18%`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/7302/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/7302?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #7302      +/-   ##
==========================================
- Coverage   81.35%   80.26%   -1.09%     
==========================================
  Files         174      174              
  Lines       33452    33475      +23     
==========================================
- Hits        27215    26870     -345     
- Misses       6237     6605     +368     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/7302?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/trainer.py](https://codecov.io/gh/huggingface/transformers/pull/7302/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmVyLnB5) | `55.62% <50.00%> (-0.11%)` | :arrow_down: |
| [src/transformers/training\_args.py](https://codecov.io/gh/huggingface/transformers/pull/7302/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmluZ19hcmdzLnB5) | `91.20% <89.47%> (-0.55%)` | :arrow_down: |
| [src/transformers/trainer\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/7302/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmVyX3V0aWxzLnB5) | `60.63% <100.00%> (+1.74%)` | :arrow_up: |
| [src/transformers/modeling\_tf\_longformer.py](https://codecov.io/gh/huggingface/transformers/pull/7302/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9sb25nZm9ybWVyLnB5) | `16.37% <0.00%> (-82.31%)` | :arrow_down: |
| [src/transformers/modeling\_longformer.py](https://codecov.io/gh/huggingface/transformers/pull/7302/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19sb25nZm9ybWVyLnB5) | `19.71% <0.00%> (-51.90%)` | :arrow_down: |
| [src/transformers/configuration\_longformer.py](https://codecov.io/gh/huggingface/transformers/pull/7302/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX2xvbmdmb3JtZXIucHk=) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
| [src/transformers/data/data\_collator.py](https://codecov.io/gh/huggingface/transformers/pull/7302/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9kYXRhL2RhdGFfY29sbGF0b3IucHk=) | `93.26% <0.00%> (ø)` | |
| [src/transformers/tokenization\_utils\_base.py](https://codecov.io/gh/huggingface/transformers/pull/7302/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90b2tlbml6YXRpb25fdXRpbHNfYmFzZS5weQ==) | `94.04% <0.00%> (+0.13%)` | :arrow_up: |
| [src/transformers/modeling\_bart.py](https://codecov.io/gh/huggingface/transformers/pull/7302/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19iYXJ0LnB5) | `94.44% <0.00%> (+0.16%)` | :arrow_up: |
| [...rc/transformers/data/datasets/language\_modeling.py](https://codecov.io/gh/huggingface/transformers/pull/7302/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9kYXRhL2RhdGFzZXRzL2xhbmd1YWdlX21vZGVsaW5nLnB5) | `94.11% <0.00%> (+1.17%)` | :arrow_up: |
| ... and [5 more](https://codecov.io/gh/huggingface/transformers/pull/7302/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/7302?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/7302?src=pr&el=footer). Last update [34a1b75...6a28276](https://codecov.io/gh/huggingface/transformers/pull/7302?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


This change breaks trainer api when people use _evaluate_during_training_ before version 3.2.0. It'll be nice to mention it in the release notes.

There is no breaking change, the argument is just deprecated. It won't be removed before the next major release.