[s2s] finetune.py: specifying generation min_length
Author: danyaljj
Pull request: yes

# What does this PR do?
Adds an argument to `finetune.py` to specify min length for text generation. 

Related to: 
https://github.com/huggingface/transformers/issues/5142#issuecomment-724938595
https://github.com/huggingface/transformers/issues/7796#issuecomment-709348940 


## Who can review?

@patrickvonplaten @patil-suraj 

Comments:
LGTM, but will break CI. no idea why it's not running.
You will need to update the tests. I bet `pytest examples/seq2seq/test_seq2seq_examples.py` will fail ( you should fix that).


Yeah, here is the error I am seeing. 

```
$ pytest examples/seq2seq/test_seq2seq_examples.py
comet_ml is installed but `COMET_API_KEY` is not set.
Traceback (most recent call last):
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 430, in _importconftest
    return self._conftestpath2mod[conftestpath]
KeyError: local('/Users/danielk/ideaProjects/transformers/examples/conftest.py')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/danielk/opt/anaconda3/bin/pytest", line 10, in <module>
    sys.exit(main())
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 58, in main
    config = _prepareconfig(args, plugins)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 196, in _prepareconfig
    pluginmanager=pluginmanager, args=args
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/manager.py", line 86, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/_pytest/helpconfig.py", line 93, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 675, in pytest_cmdline_parse
    self.parse(args)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 845, in parse
    self._preparse(args, addopts=addopts)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 809, in _preparse
    early_config=self, args=args, parser=self._parser
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/manager.py", line 86, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 719, in pytest_load_initial_conftests
    self.pluginmanager._set_initial_conftests(early_config.known_args_namespace)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 379, in _set_initial_conftests
    self._try_load_conftest(current)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 382, in _try_load_conftest
    self._getconftestmodules(anchor)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 414, in _getconftestmodules
    mod = self._importconftest(conftestpath)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 464, in _importconftest
    self.consider_conftest(mod)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 492, in consider_conftest
    self.register(conftestmodule, name=conftestmodule.__file__)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 306, in register
    ret = super(PytestPluginManager, self).register(plugin, name)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/manager.py", line 126, in register
    hook._maybe_apply_history(hookimpl)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/hooks.py", line 333, in _maybe_apply_history
    res = self._hookexec(self, [method], kwargs)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/manager.py", line 86, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Users/danielk/ideaProjects/transformers/examples/conftest.py", line 20, in pytest_addoption
    from transformers.testing_utils import pytest_addoption_shared
  File "/Users/danielk/ideaProjects/transformers/src/transformers/__init__.py", line 135, in <module>
    from .pipelines import (
  File "/Users/danielk/ideaProjects/transformers/src/transformers/pipelines.py", line 38, in <module>
    from .tokenization_auto import AutoTokenizer
  File "/Users/danielk/ideaProjects/transformers/src/transformers/tokenization_auto.py", line 119, in <module>
    from .tokenization_albert_fast import AlbertTokenizerFast
  File "/Users/danielk/ideaProjects/transformers/src/transformers/tokenization_albert_fast.py", line 23, in <module>
    from .tokenization_utils_fast import PreTrainedTokenizerFast
  File "/Users/danielk/ideaProjects/transformers/src/transformers/tokenization_utils_fast.py", line 30, in <module>
    from .convert_slow_tokenizer import convert_slow_tokenizer
  File "/Users/danielk/ideaProjects/transformers/src/transformers/convert_slow_tokenizer.py", line 25, in <module>
    from tokenizers.models import BPE, Unigram, WordPiece
ImportError: cannot import name 'Unigram' from 'tokenizers.models' (/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/tokenizers/models/__init__.py)
```

Likely caused by previous changes? 


The above error comes from a wrong version of `tokenizers` being installed.

Could you 
```
pip install --upgrade tokenizers
```

and re-run the tests? 

Have updated the branch now and I *think* the previous error has gone away. 

Looks good to me. @patil-suraj can you take a final look and merge if you want?

Something is wrong with this PR, 

1) didn't go through autoformatters
2) failing CI on current master. e.g. see: https://app.circleci.com/pipelines/github/huggingface/transformers/16336/workflows/09f5b053-9f0e-4f70-aae8-3b31c79227f0/jobs/125984 (from unrelated recent PR https://github.com/huggingface/transformers/pull/8798)
3) It looks like CI has never passed on this PR yet was merged - odd


Hey @danyaljj - sorry we merged your PR too early without exactly checking whether everything was fine or not. A couple of tests were actually failing on master due to the merge of this PR and I just reverted the PR. 

Could you maybe open a new PR and we'll all make sure this time that all tests pass? :-) 

Sorry for the inconvenience! The mistake is definitely on us here!

post mortem - for some reason this PR had no indication of CI pass/fail - one can only see its status in the merge https://github.com/huggingface/transformers/commit/5aa361f3e56de0f65720f291bb3975bfc98f2837, which fails 3 CIs. 

So this was definitely an odd situation and probably some bug in CI software itself.

The tests are failing because in s2s tests the `args` are directly passed to `finetune.py`'s `main` function and the newly added `eval_min_gen_length` is not included in it. 

Two changes to make the tests pass
1. add `eval_min_gen_length` in `CHEAP_ARGS` `dict` here https://github.com/huggingface/transformers/blob/master/examples/seq2seq/test_seq2seq_examples.py#L30
2. run `make style`