Add barthez model
Author: moussaKam
Pull request: yes

# What does this PR do?

Add BARThez models, tokenizer and docs. BARThez is a french seq2seq model that uses BART objective and architecture (https://arxiv.org/abs/2010.12321)

<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to the it if that's the case.
- [x] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/master/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/master/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?

@patrickvonplaten @sshleifer 



Comments:
You might also test that the config is identical to `BartConfig`.


Thank you @sshleifer for your review, I added some additional integration tests.

Hi @sgugger, thank you for your review, I added all the proposed changes.

As for the tokenizer, the reason for having a vocab file, is that mBarthez uses the same sentencepiece tokenizer as mBart, while discarding tokens with non-Latin characters from the embedding layers. So basically the token-ids mapping has changed. I am not sure if it is possible to change the sentencepiece model itself. Anyway I think we can keep it like that for the moment. 

Please let me know if you would like to recommend any other changes. 

Hi @LysandreJik, thank you for the review. Yes you're right, actually I was hesitating whether to redefine barthez models or not. Anyway I modified the code as requested. Hope it's ok now. 

@LysandreJik @julien-c Please let me know if any other modifications are required. Thank you in advance :) 

Hi @moussaKam! Sorry about getting back to you so late. The issue with this PR is with the implementation of the tokenizer and its fast tokenizer counterpart. Right now there is no `BarthezTokenizerFast`, which we would really need as SentencePiece is not installed by default anymore.

It seems that the `BarthezTokenizer` is very similar to the `XLMRobertaTokenizer`, so I'm trying to see if we can't do a similar conversion between your tokenizer and the resulting tokenizer. It seems completely feasible.

Do you think you could take a look at the [`convert_slow_tokenizers_checkpoints_to_fast.py` module](https://github.com/huggingface/transformers/blob/master/src/transformers/convert_slow_tokenizers_checkpoints_to_fast.py), and at the [`XLMRobertaConverter` object available in the `convert_slow_tokenizer.py` module](https://github.com/huggingface/transformers/blob/master/src/transformers/convert_slow_tokenizer.py#L466) to see if  such a  conversion if possible? Thank you.

Hi @LysandreJik, I added the fast tokenizer, thank you for the tip! Please let me know if we're good now! :)

Hi @LysandreJik, do you think we still need any changes?

I think we can merge it as it is right now, and use the `legacy_format=False` when saving the slow tokenizer. We're thinking of a way to enable this by default for fast tokenizers, but this isn't blocking for this PR. Thanks!