noamaanMulla-03/transformers-issues huggingface dataset:
Added model card for neuraly/bert-base-italian-cased-sentiment
Author: gianpy15
Pull request: yes
Labels: name: model card

Hello, we are making this pull request to add our Italian sentiment model to your repository of transformers.
Thank you again for hosting the models :)

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

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

```diff
@@            Coverage Diff             @@
##           master    #5843      +/-   ##
==========================================
- Coverage   78.50%   78.11%   -0.40%     
==========================================
  Files         146      146              
  Lines       26049    26049              
==========================================
- Hits        20450    20347     -103     
- Misses       5599     5702     +103     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5843?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_tf\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/5843/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9vcGVuYWkucHk=) | `20.27% <0.00%> (-74.92%)` | :arrow_down: |
| [src/transformers/modeling\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/5843/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19vcGVuYWkucHk=) | `81.02% <0.00%> (-1.29%)` | :arrow_down: |
| [src/transformers/generation\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5843/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9nZW5lcmF0aW9uX3RmX3V0aWxzLnB5) | `85.96% <0.00%> (-0.26%)` | :arrow_down: |
| [src/transformers/file\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5843/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `81.49% <0.00%> (+0.29%)` | :arrow_up: |
| [src/transformers/modeling\_tf\_roberta.py](https://codecov.io/gh/huggingface/transformers/pull/5843/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9yb2JlcnRhLnB5) | `93.36% <0.00%> (+49.37%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5843?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/5843?src=pr&el=footer). Last update [0b6c255...d6d30df](https://codecov.io/gh/huggingface/transformers/pull/5843?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
training script for any tensorflow based pre-trained model for question-answer
Author: Akashdesarda
Pull request: no
Labels: name: wontfix

# ❓ 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.
     -->

I am trying to train a question-answer model from scratch using TensorFlow backend. But I am getting unexpected result. It would be a great help if Hugging Face team or anyone can share training script of any TensorFlow based pre-trained model for question-answer (like 'bert-large-uncased-whole-word-masking-finetuned-squad' or 'distilbert-base-uncased-distilled-squad', etc) 
<!-- You should first ask your question on SO, and only if
     you didn't get an answer ask it here on GitHub. -->

**A link to original question on Stack Overflow**:
https://stackoverflow.com/questions/61708227/how-to-train-any-hugging-face-transformer-model-eg-distilbert-for-question-ans

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.
Vaswani's Transformer (Encoder-Decoder) decoding methods
Author: manzar96
Pull request: no
Labels: name: wontfix

Hi,

I recently studied this blog https://huggingface.co/blog/how-to-generate for using different decoding methods with PreTrained Models.

I would like to ask if it is possible to use those methods with the simple Encoder-Decoder Transformer model (as mentioned in Vaswani's paper)  (as it is available in pytorch library "torch.nn") or I have to implement those decoding methods by my own.

Thank you in advance.

Comments:
Hello @manzar96 
The `.generate` method can be used with any HF model with a LM head on top.

Ok thank you.
So it can be used only with those models https://pytorch.org/hub/huggingface_pytorch-transformers/ (having a LM head on top) 

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.
KlDivBackward
Author: alshahrani2030
Pull request: no
Labels: name: wontfix

Hi,
I fine-tune bert and using KLDivLoss instead of CrossEntropyLoss in binary classification. when I call 
loss.backward()
I got this error !?

![error-KLDiv](https://user-images.githubusercontent.com/55197626/81508647-4dd85780-92d3-11ea-9547-a9690b733a61.PNG)


Thank you in advance

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.
sentiment analysis pipeline provides option to output the original rating than positive/negative tags
Author: junhua
Pull request: no
Labels: name: wontfix

It'd be helpful to provide an option for sentiment analysis pipeline output the original ratings rather than the positive/negative tags. 

Also the documentation doesn't really explain what the output scores mean..

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.
NLQ application
Author: thiagomoeng
Pull request: no
Labels: name: wontfix

# ❓ Questions & Help

I have a pdf extractor and from this I got a dataframe with 2 columns (sections,paragraphs).
Is there any easy way to do a question and get answer like: (example)
Question: "where is the book?"
Answer: "It's on the bookshelf."
Section: "1.2.3 The Book"
Paragraph: "(Full section paragraph)"

Sorry for bad english.

Comments:
I assume you concatenate all paragraphs in a single text string, encode it with your question, and give the string as an input to your QA model (or pipeline). What you get back, is an answer span: indexes of the first and last character of the answer in the input text. To find a paragraph it belongs to,  compute indexes of the paragraph spans in your concatenated text strings. 

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.
Create README.md
Author: jannesgg
Pull request: yes
Labels: name: model card


Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5847?src=pr&el=h1) Report
> Merging [#5847](https://codecov.io/gh/huggingface/transformers/pull/5847?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/9d37c56bab8f7f1f1aa0b65be039516072254e77&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/5847/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/5847?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master    #5847   +/-   ##
=======================================
  Coverage   78.48%   78.48%           
=======================================
  Files         146      146           
  Lines       26200    26200           
=======================================
+ Hits        20563    20564    +1     
+ Misses       5637     5636    -1     
```


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

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5847?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/5847?src=pr&el=footer). Last update [9d37c56...07227e0](https://codecov.io/gh/huggingface/transformers/pull/5847?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
[not sure whether to] pin torch<=1.5.1
Author: sshleifer
Pull request: yes


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

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

```diff
@@            Coverage Diff             @@
##           master    #5836      +/-   ##
==========================================
- Coverage   78.10%   77.12%   -0.99%     
==========================================
  Files         146      146              
  Lines       26047    26047              
==========================================
- Hits        20344    20088     -256     
- Misses       5703     5959     +256     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5836?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_tf\_mobilebert.py](https://codecov.io/gh/huggingface/transformers/pull/5836/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9tb2JpbGViZXJ0LnB5) | `23.38% <0.00%> (-73.39%)` | :arrow_down: |
| [src/transformers/modeling\_tf\_electra.py](https://codecov.io/gh/huggingface/transformers/pull/5836/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9lbGVjdHJhLnB5) | `26.02% <0.00%> (-69.52%)` | :arrow_down: |
| [src/transformers/generation\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5836/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9nZW5lcmF0aW9uX3RmX3V0aWxzLnB5) | `86.21% <0.00%> (+0.25%)` | :arrow_up: |
| [src/transformers/modeling\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/5836/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19vcGVuYWkucHk=) | `82.31% <0.00%> (+1.28%)` | :arrow_up: |
| [src/transformers/modeling\_tf\_distilbert.py](https://codecov.io/gh/huggingface/transformers/pull/5836/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9kaXN0aWxiZXJ0LnB5) | `98.79% <0.00%> (+33.89%)` | :arrow_up: |
| [src/transformers/modeling\_tf\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/5836/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9vcGVuYWkucHk=) | `95.18% <0.00%> (+74.91%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5836?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/5836?src=pr&el=footer). Last update [d088d74...dd8448b](https://codecov.io/gh/huggingface/transformers/pull/5836?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
transformer dataset and masked LM
Author: siheming
Pull request: no

# ❓ Questions & Help
I was wondering about the masked LM models and the Datasets for the transformer library.

<!-- 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.
     -->

## Details
<!-- Description of your issue -->

<!-- You should first ask your question on SO, and only if
     you didn't get an answer ask it here on GitHub. -->
**A link to original question on Stack Overflow**:
https://stackoverflow.com/questions/62757772/hugging-face-tokenizer-for-masked-lm-question

Comments:
Should I also put the questions form the stackoverflow post in this issue? Or is there any problem with this issue? Did I overlook something?

Posted the solution I found on github.
wrong args name: n_gpu -> gpus
Author: donglixp
Pull request: yes

The correct argument name should be `gpus`.

The change fixed the following error:
```bash
  warnings.warn(*args, **kwargs)
Traceback (most recent call last):                                                                                                                        
  File "/home/.conda/envs/hf/lib/python3.6/site-packages/pytorch_lightning/utilities/parsing.py", line 114, in __getattr__
    return self[key]
KeyError: 'n_gpu'
```

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

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

```diff
@@            Coverage Diff             @@
##           master    #5858      +/-   ##
==========================================
- Coverage   78.66%   78.46%   -0.21%     
==========================================
  Files         146      146              
  Lines       26200    26200              
==========================================
- Hits        20611    20558      -53     
- Misses       5589     5642      +53     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5858?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_tf\_electra.py](https://codecov.io/gh/huggingface/transformers/pull/5858/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9lbGVjdHJhLnB5) | `26.02% <0.00%> (-69.52%)` | :arrow_down: |
| [src/transformers/generation\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5858/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9nZW5lcmF0aW9uX3RmX3V0aWxzLnB5) | `84.96% <0.00%> (-1.76%)` | :arrow_down: |
| [src/transformers/modeling\_tf\_distilbert.py](https://codecov.io/gh/huggingface/transformers/pull/5858/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9kaXN0aWxiZXJ0LnB5) | `98.79% <0.00%> (+33.89%)` | :arrow_up: |

------

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


great catch! was fixed on master by #5798 so I don't think we need this. Let us know if further issues!
How to only use part of pretrained model 
Author: yes1234man
Pull request: no
Labels: name: wontfix

Hi
I am using BERT for classification, I have a pretrained model, and my question is when I load the model like this:

  model = model_class.from_pretrained(
        args.model_name_or_path,
        from_tf=bool(".ckpt" in args.model_name_or_path),
        config=config,
        cache_dir=args.cache_dir if args.cache_dir else None,
    )


How can I not load the classifier, and only load the BERT encoder.
thanks


Comments:
How did you obtain your pre-trained model? Does your pre-train model have a classification head? What is `model_class`? Is it `BertForSequenceClassification`?

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.
Issues with RobertaTokenizer and unicode characters
Author: yanneyanne
Pull request: no
Labels: name: wontfix

# 🐛 Bug

## Information

Model I am using (Bert, XLNet ...):
Roberta

Language I am using the model on (English, Chinese ...):
English

## To reproduce

Steps to reproduce the behavior:

1. Insert a jumble of some weird unicode characters into the vocabulary file. These unicode characters must exist on their own somewhere else in the vocab. (Note: I didn't actually do this manual vocab editing when I encountered the bug. Since I'm using a custom vocabulary I'm simply detailing the steps to reproduce the behavior)
``` 
# vocab.txt
...
ĠOHÃ¢
...
```
(Let's say this was inserted on line 1001)
(Don't forget to account for this extra word with a change in vocab size in your config file)

2. Load an instance of `RobertaTokenizer` with this vocab file.
3. Call 
```python3
input_ids = tokenizer.encode_plus('OHÃ¢', 
                                  add_special_tokens=True,
                                  add_prefix_space=True,
                                  max_length=max_seq_length,
                                  return_token_type_ids=True)['input_ids']
print(input_ids)
```


## Expected behavior

The special start-of-word character `Ġ` will be added by the tokenizer, so the input ids we'd expect would be `[0, 1000, 2]` (given that `0` and `2` correspond to your start/end tokens, and `1000` corresponds to the index where we inserted the unicode jumble `ĠOHÃ¢`). Instead, I'm getting some seemingly unrelated input ids corresponding to other weird unicode characters not included in the inserted unicode jumble. 

## Environment info     
- `transformers` version: 2.8
- Platform: Linux and MacOS
- Python version: 3.7
- PyTorch version (GPU?): torch 1.4.
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No


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.
How to position encode a sentence?
Author: saahiluppal
Pull request: no
Labels: name: wontfix

BertTokenizer provide us with input_ids, attention_mask and token_type_ids but i'm unable to get so called "Position ids".
I have read the documentation as well but unable to find anything.

Comments:
You don't need to provide position IDs to the model, the model will create them on its own. Similarly to the `attention_mask` and `token_type_ids`, you only need to provide them if you want them to be different to the default.

In the case of position IDs, provide them if you want to use a special scheme/different to what was used when pre-training the model.

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.
How to specify a TPU IP for run_tf_glue.py?
Author: mar-muel
Pull request: no
Labels: name: wontfix

Hi team!

I have a VM on Google Cloud and a TPU. When running your example script `run_tf_glue.py` there is no option for specifying a TPU IP. It seems like the TPU cannot be auto-discovered and then training falls back to training on CPU 🐢 

Comments:
TPUs can be autodiscovered if you use them through AI-platform by running the trainer with `gcloud ai-platform jobs submit training ...` This is the advised usage of TPUs I put in the trainer.

Nevertheless if your want to use it through its name, this is done in the following PR #4270 thanks to @ViktorAlm

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.
Could you help with a huggingface/transformers pretrained models download link?
Author: yucc2018
Pull request: no
Labels: name: wontfix

# ❓ 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.
     -->

## Details
<!-- Description of your issue -->
  I am a natural language processing researcher from the Lenovo Research in Beijing. My colleagues and I really like your huggingface/transfromers framework and having been using it. I am currently writing a series of Chinese blogs about transformers, hoping to promote it to more Chinese friends. I want to download all of your pretrained models for study and experiments, but due to network problems in China, the download will be very slow and unstable. At the same time, manual downloading one by one is very troublesome. Could you kindly provide a unified download link which I can download all models? 
        Thank you.
@julien-c 
<!-- You should first ask your question on SO, and only if
     you didn't get an answer ask it here on GitHub. -->



Comments:
Hi, you can find the model identifiers in this JSON: https://huggingface.co/api/models

Then you can get all files URLs by removing `bert/` from the objects' keys and prefixing with URL endpoint "https://cdn.huggingface.co/"

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.