[BART] generation_mode as a kwarg not a class attribute
Author: sshleifer
Pull request: yes

Currently, we set it to `BartModel.decoder.generation_mode = True` and then never unset it, which is confusing in the the rare case where you try to finetune or extract features after generating.
We can encapsulate bart specific logic to modeling_bart.py by just using a kwarg.


Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/3278?src=pr&el=h1) Report
> Merging [#3278](https://codecov.io/gh/huggingface/transformers/pull/3278?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/3814e167d99c4b2e135b250d73deaa3f63ebef0c?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master    #3278      +/-   ##
==========================================
- Coverage   78.02%   78.02%   -0.01%     
==========================================
  Files          98       98              
  Lines       16670    16667       -3     
==========================================
- Hits        13007    13004       -3     
  Misses       3663     3663
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/3278?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/3278/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `93.7% <ø> (-0.16%)` | :arrow_down: |
| [src/transformers/modeling\_bart.py](https://codecov.io/gh/huggingface/transformers/pull/3278/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19iYXJ0LnB5) | `96.28% <100%> (-0.01%)` | :arrow_down: |
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/3278/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `88.37% <0%> (+0.17%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/3278?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/3278?src=pr&el=footer). Last update [3814e16...473dab8](https://codecov.io/gh/huggingface/transformers/pull/3278?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


### Summary:
`generation_mode` is a flag that
 - tells the decoder NOT to make decoder_attn_mask (ignored pad tokens and causal tokens)
 - keeps position_embeds correct even though we only decode one new token at a time.
 - tells the decoder 


The easiest way to get rid of it in `modeling_utils.py`: 
	pass a kwarg from `BartModel.prepare_inputs_from_generation` (then it never needs to be unset, and modeling_utils.py doesn't need to know about it)
	I don't know how to get rid of the logic entirely. It's tough to know whether you're in generation mode at step 0 because the cache is empty.

I updated this PR to implement the solution I proposed.

Merging, but feel free to ask further questions!