noamaanMulla-03/transformers-issues huggingface dataset:
[Model cards] Seq2Seq tags
Author: patrickvonplaten
Pull request: yes

# What does this PR do?

<!--
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 -->

Fixes # (issue)


## Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] 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.
- [ ] 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).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors which may be interested in your PR.

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

 albert, bert, XLM: @LysandreJik
 GPT2: @LysandreJik, @patrickvonplaten
 tokenizers: @mfuntowicz
 Trainer: @sgugger
 Benchmarks: @patrickvonplaten
 Model Cards: @julien-c
 Translation: @sshleifer
 Summarization: @sshleifer
 examples/distillation: @VictorSanh
 nlp datasets: [different repo](https://github.com/huggingface/nlp)
 rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
 Text Generation: @patrickvonplaten, @TevenLeScao
 Blenderbot, Bart, Marian, Pegasus: @sshleifer
 T5: @patrickvonplaten
 Rag: @patrickvonplaten, @lhoestq
 EncoderDecoder: @patrickvonplaten
 Longformer, Reformer: @patrickvonplaten
 TransfoXL, XLNet: @TevenLeScao, @patrickvonplaten
 examples/seq2seq: @sshleifer
 examples/bert-loses-patience: @JetRunner
 tensorflow: @jplu
 examples/token-classification: @stefan-it
 documentation: @sgugger
 -->


Comments:
👍
Create README.md
Author: mrm8488
Pull request: yes
Labels: name: model card

# What does this PR do?

<!--
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 -->

Fixes # (issue)


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] 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.
- [ ] 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).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors which may be interested in your PR.

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

 albert, bert, XLM: @LysandreJik
 GPT2: @LysandreJik, @patrickvonplaten
 tokenizers: @mfuntowicz
 Trainer: @sgugger
 Benchmarks: @patrickvonplaten
 Model Cards: @julien-c
 Translation: @sshleifer
 Summarization: @sshleifer
 examples/distillation: @VictorSanh
 nlp datasets: [different repo](https://github.com/huggingface/nlp)
 rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
 Text Generation: @patrickvonplaten, @TevenLeScao
 Blenderbot, Bart, Marian, Pegasus: @sshleifer
 T5: @patrickvonplaten
 Rag: @patrickvonplaten, @lhoestq
 EncoderDecoder: @patrickvonplaten
 Longformer, Reformer: @patrickvonplaten
 TransfoXL, XLNet: @TevenLeScao, @patrickvonplaten
 examples/seq2seq: @sshleifer
 examples/bert-loses-patience: @JetRunner
 tensorflow: @jplu
 examples/token-classification: @stefan-it
 documentation: @sgugger
 -->


Comments:
Create README.md
Author: dartrevan
Pull request: yes
Labels: name: model card

# What does this PR do?

<!--
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 -->

Fixes # (issue)


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] 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.
- [ ] 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).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors which may be interested in your PR.

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

 albert, bert, XLM: @LysandreJik
 GPT2: @LysandreJik, @patrickvonplaten
 tokenizers: @mfuntowicz
 Trainer: @sgugger
 Benchmarks: @patrickvonplaten
 Model Cards: @julien-c
 Translation: @sshleifer
 Summarization: @sshleifer
 examples/distillation: @VictorSanh
 nlp datasets: [different repo](https://github.com/huggingface/nlp)
 rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
 Text Generation: @patrickvonplaten, @TevenLeScao
 Blenderbot, Bart, Marian, Pegasus: @sshleifer
 T5: @patrickvonplaten
 Rag: @patrickvonplaten, @lhoestq
 EncoderDecoder: @patrickvonplaten
 Longformer, Reformer: @patrickvonplaten
 TransfoXL, XLNet: @TevenLeScao, @patrickvonplaten
 examples/seq2seq: @sshleifer
 examples/bert-loses-patience: @JetRunner
 tensorflow: @jplu
 examples/token-classification: @stefan-it
 documentation: @sgugger
 -->


Comments:
Add model_cards
Author: brandenchan
Pull request: yes
Labels: name: model card

Add model cards for new German language models. Paper [here](https://arxiv.org/abs/2010.10906)

Comments:
I think we should also add some meta-information (see [here](https://github.com/huggingface/model_card)) to the models:

```
---
language: de
license: mit
datasets:
- wikipedia
---
```

And maybe we need to add `masked-lm` to the `tags` array, so that we can use the inference widget on the model page to do some nice masking experiments :)

Awesome collaboration btw :heart: :hugs: 

> And maybe we need to add `masked-lm` to the `tags` array, so that we can use the inference widget on the model page to do some nice masking experiments :)

Shouldn't need to (in theory)

 ```json
"architectures": [
    "BertForMaskedLM"
  ],
```

is currently missing in our BERT configs -> @brandenchan would it be possible that you add it :hugs: 

> ```json
> "architectures": [
>    "BertForMaskedLM"
>  ],
> ```
> 
> is currently missing in our BERT configs -> @brandenchan would it be possible that you add it 🤗

@stefan-it Done! Out of interest, what's the difference between BertForMaskedLM and BertForPretraining?

If I remember correctly BertForPretraining loads a LM head and a NSP head (both heads trained during pretraining). Am I correct @LysandreJik?
Update README.md
Author: dartrevan
Pull request: yes
Labels: name: model card

# What does this PR do?

<!--
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 -->

Fixes # (issue)


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] 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.
- [ ] 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).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors which may be interested in your PR.

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

 albert, bert, XLM: @LysandreJik
 GPT2: @LysandreJik, @patrickvonplaten
 tokenizers: @mfuntowicz
 Trainer: @sgugger
 Benchmarks: @patrickvonplaten
 Model Cards: @julien-c
 Translation: @sshleifer
 Summarization: @sshleifer
 examples/distillation: @VictorSanh
 nlp datasets: [different repo](https://github.com/huggingface/nlp)
 rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
 Text Generation: @patrickvonplaten, @TevenLeScao
 Blenderbot, Bart, Marian, Pegasus: @sshleifer
 T5: @patrickvonplaten
 Rag: @patrickvonplaten, @lhoestq
 EncoderDecoder: @patrickvonplaten
 Longformer, Reformer: @patrickvonplaten
 TransfoXL, XLNet: @TevenLeScao, @patrickvonplaten
 examples/seq2seq: @sshleifer
 examples/bert-loses-patience: @JetRunner
 tensorflow: @jplu
 examples/token-classification: @stefan-it
 documentation: @sgugger
 -->


Comments:
Customize tokenizer in model card's widget
Author: Ethan-yt
Pull request: no

I trained a Chinese Roberta model. In the model card, the widget uses a tokenizer defined in config.json(`RobertaTokenizer`). But my model uses `BertTokenizer`. Can I customize the tokenizer in the widget of the model card just like I can choose any combination of model and tokenizer in a pipeline?

Comments:
I tried to use `BertModel` instead of `RobertaModel` (copy weights from Roberta to Bert). But the position embedding is different. And the outputs are different... So I have to use this combination of `RobertaModel` and `BertTokenizer`. Is that mean I can't use the inference widget?

Yes, this is possible. See https://github.com/huggingface/transformers/commit/ed71c21d6afcbfa2d8e5bb03acbb88ae0e0ea56a, you should add a `tokenizer_class` attribute to your config.json with the tokenizer class you want to use.

cc @sgugger @LysandreJik I have no idea if this is currently documented or just in the code 🤭

> Yes, this is possible. See [ed71c21](https://github.com/huggingface/transformers/commit/ed71c21d6afcbfa2d8e5bb03acbb88ae0e0ea56a), you should add a `tokenizer_class` attribute to your config.json with the tokenizer class you want to use.
> 
> cc @sgugger @LysandreJik I have no idea if this is currently documented or just in the code 🤭

Thank you! It works. I think you are right and I did not find this configuration in the documentation: https://huggingface.co/transformers/main_classes/configuration.html

Looks like that guy who made the PR did not document the new argument he added :-p 

arg, who does that guy think he is? 😂
Smarter prediction loop and no- -> no_ in console args
Author: sgugger
Pull request: yes

# What does this PR do?

This PR does two things:
- the first one is to replace `no-` to `no_` in the `HFArgumentParser` so that arguments get a more consistent name: for instance `use_tokenizer_fast` in the new examples script give an argument `no-use_tokenizer_fast` and the inconsistency between - and _ makes it hard to find.
- the second one is to avoid computing the predictions and labels (and storing them) in the evaluation of a `Trainer` when there is no `compute_metrics` function.

Comments:
Vocab files missing in community pre-trained t5 model
Author: penatbater
Pull request: no

## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->
     
- `transformers` version: 3.4.0
- Platform: Linux-5.4.0-1028-gcp-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.6.9
- PyTorch version (GPU?): 1.6.0 (False)
- Tensorflow version (GPU?): not installed (NA)
- Using GPU in script?: False
- Using distributed or parallel set-up in script?: False

### Who can help
Summarization: @sshleifer
 

## Information

I am trying to use the sshleifer/t5-base-cnn for summarization task, but there seems to be an issue with the tokenizer portion. I tried looking at the files part in https://huggingface.co/sshleifer/t5-base-cnn# and there doesn't seem to be a vocab file there.


>tokenizer = AutoTokenizer.from_pretrained("sshleifer/t5-base-cnn")
>model = AutoModelWithLMHead.from_pretrained("sshleifer/t5-base-cnn")

>OSError: Model name 'sshleifer/t5-base-cnn' was not found in tokenizers model name list (t5-small, t5-base, t5-large
, t5-3b, t5-11b). We assumed 'sshleifer/t5-base-cnn' was a path, a model identifier, or url to a directory containin
g vocabulary files named ['spiece.model'] but couldn't find such vocabulary files at this path or url.



Comments:
I'm guessing you can use the tokenizer from t5-base (https://huggingface.co/t5-base#list-files) but @sshleifer can confirm or infirm

> I'm guessing you can use the tokenizer from t5-base (https://huggingface.co/t5-base#list-files) but @sshleifer can confirm or infirm

This is what I used in the interim. I'm just not sure if there are some implications with using a different tokenizer with the fine-tuned model.

Correct all t5 tokenizers are identical. There will be no issue.
Add a template for examples and apply it for mlm and plm examples
Author: sgugger
Pull request: yes

# What does this PR do?

This PR adds a cookiecutter template to add a new example and experiments with it to add the run_mlm new script and a run_plm specific to XLNet. It runs with the same results as the old version.

Side note: the part for random masking applied in a data collator can become platform agnostic later on, if datasets adds a lazy map method.

Comments:
New template for example and MLM example.
Author: sgugger
Pull request: yes
Labels: name: model card

# What does this PR do?

This PR adds a cookiecutter template to add a new example and experiments with it to add the `run_mlm` new script. It runs with the same results as the old version. I'll also add a `run_plm` specific to XLNet then update the README and remove the old script.

Side note: the part for random masking applied in a data collator can become platform agnostic later on, if datasets adds a lazy map method.


Comments:
[testing] distributed: correct subprocess output checking
Author: stas00
Pull request: yes

This PR fixes an issue revealed on CI - https://github.com/huggingface/transformers/runs/1327577422

* the external subprocess runner will now be more flexible and check `stdout|stderr` to validate that the subprocess sent at least some output. Currently the code checks only `stdout` which isn't right since the subprocess may not generate any.
* adds `stdout:` prefix to subprocess' stdout, like it was already doing for `stderr`.

@sgugger 

Comments:
Fix eval ref miss in Chinese WWM.
Author: wlhgtc
Pull request: yes

Sorry for my reckless: I didn't add param for `eval_ref_file` when Chinese WWM.
It was found by @johnsonice in [here](https://github.com/huggingface/transformers/pull/7925#issuecomment-717701325).

So I fix it and update readme for Chinese WWM.

Comments:
Before we merge you'll need to run `make fixup` or `make style` at the root of your transformers clone to pass the code quality test.

I had not realized that LTP has pinned master to 3.2.0. We can't have a script in examples that doesn't run on master, so I suggest copying the current version and moving it in the examples/contrib folder (or hosting it on your GitHub if you prefer) while still linking to it from the README.

We are in the process of rewriting all examples (and this script as it is will change in the next few days) to match the current version of transformers/datasets so this master requirement is really important. 

> I had not realized that LTP has pinned master to 3.2.0. We can't have a script in examples that doesn't run on master, so I suggest copying the current version and moving it in the examples/contrib folder (or hosting it on your GitHub if you prefer) while still linking to it from the README.
> 
> We are in the process of rewriting all examples (and this script as it is will change in the next few days) to match the current version of transformers/datasets so this master requirement is really important.

Seem the requirements of LTP is fixed. 
So I move to `run_chinese_ref.py` to `examples/contrib` and update readme.

Great! If you can just merge Lysandre's suggestion, this should be good to merge then.

Applied the suggestion, merging!
Fix typo: indinces -> indices
Author: bryant1410
Pull request: yes


Comments:
> Looks good, thanks! Just make sure to run `make style` to have our scripts automatically fix the files you changed.

Oh. So should I send a new patch with the changes after running `make style`?

I'm not following. Your last commit had the styling changes so all is good.

> I'm not following. Your last commit had the styling changes so all is good.

Oh. But if I run `make style` I see tons of changes (193 files changed, 754 insertions(+), 2969 deletions(-)). For example, this file:

```diff
diff --git a/examples/adversarial/utils_hans.py b/examples/adversarial/utils_hans.py
index bf0623ff..17d4a8c4 100644
--- a/examples/adversarial/utils_hans.py
+++ b/examples/adversarial/utils_hans.py
@@ -112,10 +112,7 @@ if is_torch_available():
             cached_features_file = os.path.join(
                 data_dir,
                 "cached_{}_{}_{}_{}".format(
-                    "dev" if evaluate else "train",
-                    tokenizer.__class__.__name__,
-                    str(max_seq_length),
-                    task,
+                    "dev" if evaluate else "train", tokenizer.__class__.__name__, str(max_seq_length), task,
                 ),
             )
             label_list = processor.get_labels()
@@ -281,10 +278,7 @@ class HansProcessor(DataProcessor):
 
 
 def hans_convert_examples_to_features(
-    examples: List[InputExample],
-    label_list: List[str],
-    max_length: int,
-    tokenizer: PreTrainedTokenizer,
+    examples: List[InputExample], label_list: List[str], max_length: int, tokenizer: PreTrainedTokenizer,
 ):
     """
     Loads a data file into a list of ``InputFeatures``
```

Are you sure you have proper versions of black/isort/flake8 ? Run `pip install -e .[dev]` in the repo to make sure you have them.


Oh, yeah, it was that. Silly mistake. :hand: Sorry for the noise!

Np!