noamaanMulla-03/transformers-issues huggingface dataset:
Fix #5114
Author: sgugger
Pull request: yes

This fixes #5114, with a test to make sure there is no regression again.

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

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

```diff
@@            Coverage Diff             @@
##           master    #5122      +/-   ##
==========================================
- Coverage   77.39%   77.27%   -0.13%     
==========================================
  Files         133      133              
  Lines       22167    22167              
==========================================
- Hits        17157    17130      -27     
- Misses       5010     5037      +27     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5122?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/data/data\_collator.py](https://codecov.io/gh/huggingface/transformers/pull/5122/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9kYXRhL2RhdGFfY29sbGF0b3IucHk=) | `98.33% <100.00%> (ø)` | |
| [src/transformers/data/processors/squad.py](https://codecov.io/gh/huggingface/transformers/pull/5122/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9kYXRhL3Byb2Nlc3NvcnMvc3F1YWQucHk=) | `28.66% <0.00%> (-4.78%)` | :arrow_down: |
| [src/transformers/modeling\_xlnet.py](https://codecov.io/gh/huggingface/transformers/pull/5122/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ194bG5ldC5weQ==) | `76.35% <0.00%> (-2.30%)` | :arrow_down: |
| [src/transformers/modeling\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5122/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `91.18% <0.00%> (+0.12%)` | :arrow_up: |
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5122/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `87.59% <0.00%> (+0.15%)` | :arrow_up: |

------

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


👍
Unable to load german BERT model
Author: dakshvar22
Pull request: no
Labels: name: wontfix

# 🐛 Bug

## Information

Model I am using (Bert, XLNet ...): BERT

Language I am using the model on (English, Chinese ...): German

The problem arises when using:
* [x] the official example scripts: (give details below)
* [ ] my own modified scripts: (give details below)

The tasks I am working on is:
* [ ] an official GLUE/SQUaD task: (give the name)
* [x] my own task or dataset: (give details below)

## To reproduce

Steps to reproduce the behavior:

```
from transformers import *
model = TFBertModel.from_pretrained('bert-base-german-dbmdz-cased')
```

I get the following error trace - 

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/daksh/miniconda3/envs/1.8/lib/python3.6/site-packages/transformers/modeling_tf_utils.py", line 351, in from_pretrained
    assert os.path.isfile(resolved_archive_file), "Error retrieving file {}".format(resolved_archive_file)
  File "/Users/daksh/miniconda3/envs/1.8/lib/python3.6/genericpath.py", line 30, in isfile
    st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
```

## Expected behavior

Model should be loaded

## Environment info
     
- `transformers` version: 2.4.1
- Platform: Mac OS
- Python version: 3.6.5
- Tensorflow version (GPU?): 2.1.0
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No


Comments:
That particular model doesn't have a TF version: https://huggingface.co/bert-base-german-dbmdz-cased#list-files

However, you should be able to convert the PyTorch version to TF, using the `from_pt=True` flag.

Thanks for clarifying that @julien-c . Is it possible to add this information(regarding availability of TF and pytorch models) somewhere on this [page](https://huggingface.co/transformers/pretrained_models.html) or maybe a dedicated table for it. It's quite useful info for frameworks which depend on Transformers. 

I'm working on converting our DBMDZ models to TF 😅

The same issue is true for the `uncased` version. Is there a way to force to HuggingFace to download the Torch version instead? 

Yes, as I said: `from_pt=True`

@hotzenklotz You can now use the model under our DBMDZ namespace: `dbmdz/bert-base-german-cased`.

I've uploaded the TF-compatible model and it can be used with:

```bash
from transformers import *
model = TFBertModel.from_pretrained('dbmdz/bert-base-german-cased')
```

Please let me know if it's working for you!

@stefan-it Thank you so much. Can we expect to see a TF version of the `uncased` model as well? (And what about Roberta?)

`dbmdz/bert-base-german-uncased` has also a TF-compatible model now :)

German RoBERTa is currently not planned on our side (unless there's a TPU-supported pre-training script out there) 😅

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Fix PABEE's result table
Author: JetRunner
Pull request: yes


Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5158?src=pr&el=h1) Report
> Merging [#5158](https://codecov.io/gh/huggingface/transformers/pull/5158?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/aa6a29bc25b663e1311c5c4fb96b004cf8a6d2b6&el=desc) will **increase** coverage by `0.02%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master    #5158      +/-   ##
==========================================
+ Coverage   77.92%   77.94%   +0.02%     
==========================================
  Files         137      137              
  Lines       23475    23475              
==========================================
+ Hits        18292    18298       +6     
+ Misses       5183     5177       -6     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5158?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5158/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `85.96% <0.00%> (+0.14%)` | :arrow_up: |
| [src/transformers/file\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5158/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `75.40% <0.00%> (+0.40%)` | :arrow_up: |
| [src/transformers/modeling\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/5158/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19vcGVuYWkucHk=) | `80.90% <0.00%> (+1.38%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5158?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/5158?src=pr&el=footer). Last update [aa6a29b...23f6a30](https://codecov.io/gh/huggingface/transformers/pull/5158?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
fix typo
Author: timsuchanek
Pull request: yes


Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5073?src=pr&el=h1) Report
> Merging [#5073](https://codecov.io/gh/huggingface/transformers/pull/5073?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/e4aaa4580515446cd5a2972ab42fec0b95819c84&el=desc) will **increase** coverage by `0.00%`.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master    #5073   +/-   ##
=======================================
  Coverage   77.26%   77.26%           
=======================================
  Files         133      133           
  Lines       22146    22146           
=======================================
+ Hits        17110    17111    +1     
+ Misses       5036     5035    -1     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5073?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5073/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `87.42% <0.00%> (+0.15%)` | :arrow_up: |

------

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


Thanks for catching it.
[pl_examples] deprecate BaseTransformer.is_logger
Author: sshleifer
Pull request: yes

- proc_rank is deprecated in new PL
- updates pl to 0.8.1

@williamFalcon suggestions more than welcome!


- The test that is failing is `test_bdc_multigpu`

Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5140?src=pr&el=h1) Report
> Merging [#5140](https://codecov.io/gh/huggingface/transformers/pull/5140?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/84be482f6698fac822a5113735f2242c6d3abc76&el=desc) will **decrease** coverage by `0.00%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master    #5140      +/-   ##
==========================================
- Coverage   77.19%   77.19%   -0.01%     
==========================================
  Files         133      133              
  Lines       22232    22232              
==========================================
- Hits        17162    17161       -1     
- Misses       5070     5071       +1     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5140?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5140/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `85.81% <0.00%> (-0.15%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5140?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/5140?src=pr&el=footer). Last update [84be482...2aad9d1](https://codecov.io/gh/huggingface/transformers/pull/5140?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
TFXLMRoberta impossible to load base and large model with pretrained weight ?
Author: Shiro-LK
Pull request: no
Labels: name: wontfix

# 🐛 Bug

## Information

Model I am using (Bert, XLNet ...):
XLMRoberta
Language I am using the model on (English, Chinese ...):

The problem arises when using:
* [ x] the official example scripts: (give details below)


The tasks I am working on is:
my own task or dataset: (give details below)

## To reproduce

launch the command :
`model = TFXLMRobertaForSequenceClassification.from_pretrained(pretrained_model_name_or_path="xlm-roberta-large" )`
Steps to reproduce the behavior:

1. from transformers import*
2. launch the command above
3. error : 

> TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType


## Expected behavior

model should be load.

## Environment info
     
- `transformers` version: 2.6.0
- Platform: colab

- Tensorflow version (GPU?):2.1 gpu
- Using GPU in script?: yes
- Using distributed or parallel set-up in script?: no


Comments:
maybe u can use from_pt=True
TFXLMRobertaForSequenceClassification.from_pretrained(pretrained_model_name_or_path="xlm-roberta-large", **_from_pt=True_**)

Hi, thanks for your answer.
I got exactly the same message with "from_pt=True"

I am suspecting that the file does not exist.
I succeed to load with TFXLMRoberta doing that :

```
m = XLMRobertaForSequenceClassification.from_pretrained("xlm-roberta-base", num_labels=1)
m.save_pretrained("./")
del m
model = TFXLMRobertaForSequenceClassification.from_pretrained("./", , num_labels=1, from_pt=True)
```

Hello, indeed there is no official XLM-R checkpoint. You can use @jplu's [checkpoint from the modelhub](https://huggingface.co/models/?search=jplu%2Ftf-xlm):

```py
m = TFXLMRobertaForSequenceClassification.from_pretrained("jplu/tf-xlm-roberta-base", num_labels=1)
```

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Calculated offsets are wrong in squad.py
Author: ericperfect
Pull request: no
Labels: name: wontfix

- when tokenizer.padding_side == "left" and if tokenizer.pad_token_id in span["input_ids"]:
doc_offset should add last_padding_id_position+1 instead of 0.
       
        start_position = 0
        end_position = 0
        if is_training and not span_is_impossible:
            # For training, if our document chunk does not contain an annotation
            # we throw it out, since there is nothing to predict.
            doc_start = span["start"]
            doc_end = span["start"] + span["length"] - 1
            out_of_span = False

            if not (tok_start_position >= doc_start and tok_end_position <= doc_end):
                out_of_span = True

            if out_of_span:
                start_position = cls_index
                end_position = cls_index
                span_is_impossible = True
            else:
                if tokenizer.padding_side == "left":
                    doc_offset = 0
                else:
                    doc_offset = len(truncated_query) + sequence_added_tokens

                start_position = tok_start_position - doc_start + doc_offset
                end_position = tok_end_position - doc_start + doc_offset

Comments:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Using fill-mask pipeline to get the “score” for a result it didn't suggest
Author: p-christ
Pull request: no
Labels: name: wontfix

Hi lovely huggingface people,

I'm trying to use your fill-mask pipeline in order to get the score for a result it didn't suggest. 

For example, if my sentence is `"I ate bacon and <mask> for breakfast"` I can use `pipeline('fill-mask')` to get back predictions and their scores e.g. it might give me back `["eggs", 0.1]`. But what I would like to do is **provide my own guess and then get back the score it assigns to my own guess.** e.g. i might want to know what score it gives to the word "pancakes" in the situation.

Is this possible? If not can I register it as a feature request? 

Stack overflow [question](https://stackoverflow.com/questions/61168513/using-huggingface-fill-mask-pipeline-to-get-the-score-for-a-result-it-didnt-s)

Comments:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
[examples] fixes arguments for summarization finetune scripts
Author: ieBoytsov
Pull request: yes

This PR fixes arguments in bash scripts for finetuning bart/bart_tiny/t5 models in summarization examples.

After changes that were merged in #4951 i noticed some small problems. That includes:
* missing default arguments for `finetune.py` (--data_dir, output_dir)
* invalid argument name for number of gpu to use (`n_gpu` instead of `gpus`)
* argument `model_type` that is not present in list of arguments and crashes the script

Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5157?src=pr&el=h1) Report
> Merging [#5157](https://codecov.io/gh/huggingface/transformers/pull/5157?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/68e19f1c228c92d5d800533f558faff24b57127a&el=desc) will **increase** coverage by `0.00%`.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master    #5157   +/-   ##
=======================================
  Coverage   77.93%   77.94%           
=======================================
  Files         137      137           
  Lines       23475    23475           
=======================================
+ Hits        18295    18297    +2     
+ Misses       5180     5178    -2     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5157?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/file\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5157/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `75.00% <0.00%> (-0.41%)` | :arrow_down: |
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5157/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `85.96% <0.00%> (-0.15%)` | :arrow_down: |
| [src/transformers/modeling\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/5157/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19vcGVuYWkucHk=) | `80.90% <0.00%> (+1.38%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5157?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/5157?src=pr&el=footer). Last update [68e19f1...49b1e42](https://codecov.io/gh/huggingface/transformers/pull/5157?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
Word Embedding input to GPT-2
Author: jinga-lala
Pull request: no

# ❓ Questions & Help


<!-- The GitHub issue tracker is primarly intended for bugs, feature requests,
     new models and benchmarks, and migration questions. For all other questions,
     we direct you to Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. Make sure to tag your question with the
     right deep learning framework as well as the huggingface-transformers tag: 
     https://stackoverflow.com/questions/tagged/huggingface-transformers 
     
     If your question wasn't answered after a period of time on Stack Overflow, you
     can always open a question on GitHub. You should then link to the SO question 
     that you posted.
     -->
Is there any way in which we can give custom word embeddings as input to GPT-2 instead of tokenized words?



Comments:
You can pass embeddings to the model by using the `input_embeds` keyword argument:
```
result = model(input_embeds=...)
```
They should be if shape `batch_size, sequence_length, hidden_size)`.

Hi @sgugger 
I tried the following code snippet but it is giving an error
<pre>
    from transformers import GPT2Tokenizer, GPT2LMHeadModel
    modelGPT = GPT2LMHeadModel.from_pretrained('gpt2')
    modelGPT(input_embeds=out[2][-1]) #where out[2][-1] is of shape [64, 60, 768] --> [batch_size, sequence_length, hidden_size]
</pre>

Error:
<pre>
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-81-40a402b51d0d> in <module>()
----> 3 modelGPT(input_embeds=out[2][-1])

/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    548             result = self._slow_forward(*input, **kwargs)
    549         else:
--> 550             result = self.forward(*input, **kwargs)
    551         for hook in self._forward_hooks.values():
    552             hook_result = hook(self, input, result)

TypeError: forward() got an unexpected keyword argument 'input_embeds'
</pre>

Sorry I made a typo, I meant `inputs_embeds` (with an s).

Worked like a charm! Thanks