noamaanMulla-03/transformers-issues huggingface dataset:
HooshvareLab readme parsbert-armananer
Author: m3hrdadfi
Pull request: yes
Labels: name: model card

Readme for HooshvareLab/bert-base-parsbert-armananer-uncased

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

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

```diff
@@            Coverage Diff             @@
##           master    #4666      +/-   ##
==========================================
+ Coverage   77.19%   77.83%   +0.63%     
==========================================
  Files         128      128              
  Lines       21021    21021              
==========================================
+ Hits        16228    16362     +134     
+ Misses       4793     4659     -134     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4666?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4666/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `90.17% <0.00%> (+0.23%)` | :arrow_up: |
| [src/transformers/modeling\_gpt2.py](https://codecov.io/gh/huggingface/transformers/pull/4666/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19ncHQyLnB5) | `86.21% <0.00%> (+14.10%)` | :arrow_up: |
| [src/transformers/data/processors/squad.py](https://codecov.io/gh/huggingface/transformers/pull/4666/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9kYXRhL3Byb2Nlc3NvcnMvc3F1YWQucHk=) | `56.68% <0.00%> (+28.02%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4666?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/4666?src=pr&el=footer). Last update [b5015a2...49068a5](https://codecov.io/gh/huggingface/transformers/pull/4666?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
HooshvareLab readme parsbert-ner
Author: m3hrdadfi
Pull request: yes
Labels: name: model card

Readme for HooshvareLab/bert-base-parsbert-ner-uncased

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

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

```diff
@@            Coverage Diff             @@
##           master    #4665      +/-   ##
==========================================
+ Coverage   77.19%   77.41%   +0.21%     
==========================================
  Files         128      128              
  Lines       21021    21021              
==========================================
+ Hits        16228    16274      +46     
+ Misses       4793     4747      -46     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4665?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4665/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `88.66% <0.00%> (ø)` | |
| [src/transformers/modeling\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4665/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `90.17% <0.00%> (+0.23%)` | :arrow_up: |
| [src/transformers/modeling\_gpt2.py](https://codecov.io/gh/huggingface/transformers/pull/4665/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19ncHQyLnB5) | `86.21% <0.00%> (+14.10%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4665?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/4665?src=pr&el=footer). Last update [b5015a2...e727442](https://codecov.io/gh/huggingface/transformers/pull/4665?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
Fix onnx export input names order
Author: RensDimmendaal
Pull request: yes

This PR makes it possible to export custom bert models to onnx.

It resolves the issue addressed [here](https://github.com/huggingface/transformers/issues/4523#issuecomment-634920569).

TODO: 
- [x] update ensure_valid_input function
- [x] update test ensure_valid_input_function
- [x] update convert_pytorch
- [x] add a test of exporting a custom pytorch models


@mfuntowicz

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

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

```diff
@@            Coverage Diff             @@
##           master    #4641      +/-   ##
==========================================
- Coverage   78.04%   78.01%   -0.03%     
==========================================
  Files         123      123              
  Lines       20477    20477              
==========================================
- Hits        15981    15975       -6     
- Misses       4496     4502       +6     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4641?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/hf\_api.py](https://codecov.io/gh/huggingface/transformers/pull/4641/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9oZl9hcGkucHk=) | `93.06% <0.00%> (-4.96%)` | :arrow_down: |
| [src/transformers/file\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4641/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `73.44% <0.00%> (-0.42%)` | :arrow_down: |

------

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


@mfuntowicz what do you think of my proposed changes?

I'm not sure why the CI fails on `TFAutoModelTest.test_from_identifier_from_model_type` as I haven't touched it.

LGTM! Thanks @RensDimmendaal for looking at this :)

@LysandreJik should we merge with the failing test? It seems totally unrelated
Cannot load labels from old models
Author: GuillemGSubies
Pull request: no
Labels: name: Core: Modeling

# ❓ Questions & Help

If I load a model from 2.8 or older in 2.9 o newer, the labels from my model are changed automatically so all the tests in my code start to fail because instead of predicting `I-PER` it predicts `LABEL_2`.

After reading the source code I think I found what happens but I'm not quite sure.  I think it all started here in #3967

https://github.com/huggingface/transformers/blob/e7cfc1a313cc928e962bb8699868f5dcf46f11eb/src/transformers/configuration_utils.py#L123

In the code above you can see that the labels dicts are modified if we set `num_labels`. I couldn't find the place in the code where that is done, but it definetly modifies 2 attributes from the class. I don't really think that a setter for attribute A, should change attributes B and C.

Am I missing something when loading my models?

Thanks you so much for reading and for the library, we all love it <3


Comments:
I think I see where that could be a problem, indeed. Do you mind sharing your model configuration file so that I may take a closer look?

Here it is:

```
{
  "architectures": [
    "BertForTokenClassification"
  ],
  "attention_probs_dropout_prob": 0.3,
  "bos_token_id": 0,
  "do_sample": false,
  "eos_token_ids": 0,
  "finetuning_task": null,
  "hidden_act": "gelu",
  "hidden_dropout_prob": 0.3,
  "hidden_size": 768,
  "id2label": {
    "0": "I-MISC",
    "1": "B-MISC",
    "2": "O",
    "3": "I-LOC",
    "4": "I-ORG",
    "5": "B-LOC",
    "6": "B-ORG",
    "7": "I-PER",
    "8": "B-PER"
  },
  "initializer_range": 0.02,
  "intermediate_size": 3072,
  "is_decoder": false,
  "label2id": {
    "I-MISC": 0,
    "B-MISC": 1,
    "O": 2,
    "I-LOC": 3,
    "I-ORG": 4,
    "B-LOC": 5,
    "B-ORG": 6,
    "I-PER": 7,
    "B-PER": 8
  },
  "layer_norm_eps": 1e-12,
  "length_penalty": 1.0,
  "max_length": 20,
  "max_position_embeddings": 512,
  "model_type": "bert",
  "num_attention_heads": 12,
  "num_beams": 1,
  "num_hidden_layers": 12,
  "num_labels": 9,
  "num_return_sequences": 1,
  "output_attentions": false,
  "output_hidden_states": false,
  "output_past": true,
  "pad_token_id": 0,
  "pruned_heads": {},
  "repetition_penalty": 1.0,
  "temperature": 1.0,
  "top_k": 50,
  "top_p": 1.0,
  "torchscript": false,
  "type_vocab_size": 2,
  "use_bfloat16": false,
  "vocab_size": 28996
}
```


@GuillemGSubies Thanks for reporting, I can reproduce this issue.

To fix it on your side while we push a fix, you can just remove the `num_labels` attribute from your config.json, it's not needed anymore. Let me know if this solves your issue.

Thanks you very much. I will do that :heart: 

Should also be fixed on master by 751a1e08904fda197366e4b0033bdfb8b10d256c
Write With Transformer: PPLM page is broken
Author: songproducer
Pull request: no
Labels: name: Need more information

# 🐛 Bug 

Triggering autocomplete results in endless spinning.

iOS safari But also desktop Safari, Firefox and Chrome.


Comments:
I cannot reproduce your problem. Can you try again?

I tried again. 

Console on dev tools shows:

```
DevTools failed to load SourceMap: Could not load content for chrome-extension://ibnejdfjmmkpcnlpebklmnkoeoihofec/dist/contentScript.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load SourceMap: Could not load content for chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/contentscript.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load SourceMap: Could not load content for chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/inpage.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load SourceMap: Could not load content for chrome-extension://ibnejdfjmmkpcnlpebklmnkoeoihofec/dist/pageHook.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
```

Those are unrelated warnings related to source maps. I can;t reproduce your problem and I tried on different browsers. Can you clear the cache/try in private mode/incognito?

<img width="2543" alt="Screen Shot 2020-06-01 at 1 50 50 am" src="https://user-images.githubusercontent.com/597346/83359074-6acfea00-a3aa-11ea-97e9-d9fa0ed872ea.png">
Still no luck

D'oh, I didn't check the PPLM page. The other versions of Write With Transformer seem to work, but you are right that it doesn't seem to work for [PPLM](https://transformer.huggingface.co/doc/pplm). When you trigger "autocomplete", the web page seems to hang.

cc @julien-c 

Yes, we turned off the PPLM machine as it was costly to host. We need to add a notice to try it locally instead, and/or re-spawn a cheaper machine. Both are on our todo-list.

Added a notice there: https://transformer.huggingface.co/doc/pplm
Tensorflow XLMRoberta Multi-Class Problem
Author: kjans123
Pull request: no

## Details

I am attempting to fine tune an XLMRoberta sequence classification model. I have an array of text snippets from physicians labelled 1-8 with various diagnostic indications. I've created a tensorflow dataset object with the 
```
convert_raw_to_xlmroberta_tfdataset()
```
 function seen here (https://stackoverflow.com/questions/62095316/tensorflow-xlmroberta-multi-class)

I then create the model:
```
from transformers import TFXLMRobertaForSequenceClassification
import tensorflow as tf



learning_rate = 2e-5

number_of_epochs = 2
model = TFXLMRobertaForSequenceClassification.from_pretrained("jplu/tf-xlm-roberta-base")
optimizer = tf.keras.optimizers.Adam(learning_rate=learning_rate, epsilon=1e-08)
loss = tf.keras.losses.SparseCategoricalCrossentropy()
metric = tf.keras.metrics.SparseCategoricalAccuracy('accuracy')
model.compile(optimizer=optimizer, loss=loss, metrics=[metric])
```
but consistently get this error:
```
ValueError: Shapes (None, 1, 8) and (None, 2) are incompatible
```
(full trace at the above SO link). 

I've tried both Sparse Categorical Cross Entropy and just Categorical Cross Entropy. I've used one-hot encoded labels and "normal" labels. Is it even possible to do multi-class classification with TFXLMRoberta? It started to work when I fed in a binary dummy set of labels.



Comments:
Hello! If you're using 8 labels, you'll need to tell the model that it needs to do 8-way classification. You can do so by specifying the `num_labels` argument during instantiation:

```py
model = TFXLMRobertaForSequenceClassification.from_pretrained(
    "jplu/tf-xlm-roberta-base", 
    num_labels=8
)
```

Let me know if this fixes your issue.

Yes! That fixed the issue. I apologize for my oversight of that argument. Thank you very much for your time.

Sure, my pleasure!
How tokenizers work
Author: Aktsvigun
Pull request: no

Good afternoon. 
If possible, I would ask a few questions which I cannot solve for several days running.

1) What does the file _merge.txt_ mean which is used in `ByteLevelBPETokenizer`? Does it store the config for the tokenizer? I deepened into it, however, did not manage to understand its purpose.
2) Is it possible to get offsets for the text when using models-stacked tokenizers? For instance, I am using ElectraTokenizer and I would like it to return the offsets for my texts - do you probably have any templates of how to do it?

Thanks in advance!

Comments:
pinging @n1t0, lead on [huggingface/tokenizers](https://github.com/huggingface/tokenizers) :)

Thank you! Closing it here, moved link: [https://github.com/huggingface/tokenizers/issues/290](url)
GPT2LMHeadModel Documentation Mismatch for labels
Author: cdpierse
Pull request: no

# 🐛 Bug

## Information

This is a very small discrepancy between the docs and code for the `GPT2LMHeadModel`. 

Docs mention setting `lm_labels = input_ids`  https://github.com/huggingface/transformers/blob/520e7f211926e07b2059bc8e21b668db4372e4db/src/transformers/modeling_gpt2.py#L547-L552


Should this read `labels = input_ids` instead ?
Since this is the single LM Model head it only has one `labels` param unlike the double head model?


Comments:
I guess you are right. The same is true for transformer-xl as well. 
Code: https://github.com/bajajahsaas/transformers/blob/master/src/transformers/modeling_transfo_xl.py#L855

Yes, I think you guys are right! Thanks for pointing this out. I think we should do a general name cleaning here. 

See linked PR.

This was fixed by #4711
[Naming] lm_labels -> labels ; masked_lm_labels -> masked_labels
Author: patrickvonplaten
Pull request: yes

This PR is a simple find and replace of the regex "lm_labels" into "labels" over all files.
This way we can use the Trainer class for all models. 

It does break backward compatibility a bit though, since some people will have to rename the `lm_labels` argument in their code. 



Comments:
Yeah that's quite a big breaking change 🤣
we may want to be a little bit careful on backward compatibility

I think this would be a very welcome update. Maybe adding an alias to the method signature would be sufficient to maintain compatibility?

We could deprecate the old ones as well, with a warning and remove them in a future version.

Yes adding an alias would be good for me.

One possible option to deprecate progressively (that Keras use for instance) is to move the old parameters in `**kwargs` so they are not advocated anymore and add a deprecation warning later on.
Specify PyTorch versions
Author: LysandreJik
Pull request: yes

Specify that the examples require a different PyTorch version than the base library.

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

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

```diff
@@            Coverage Diff             @@
##           master    #4710      +/-   ##
==========================================
+ Coverage   77.32%   77.38%   +0.05%     
==========================================
  Files         128      128              
  Lines       21071    21071              
==========================================
+ Hits        16294    16305      +11     
+ Misses       4777     4766      -11     
```


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

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4710?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/4710?src=pr&el=footer). Last update [6449c49...6081929](https://codecov.io/gh/huggingface/transformers/pull/4710?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
Error loading finetuned bert model AttributeError: 'NoneType' object has no attribute 'endswith'
Author: aurooj
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
<!--  -->
Unable to load finetuned bert model for language modeling task using run_language_modeling.py script
<!---->
I used the following code to load a fine-tuned model saved on my disk:
`BertForMaskedLM.from_pretrained('outputs/pytorch_model.bin', config=config, from_tf=True).` however I am getting the following error:
Traceback (most recent call last):
  File "/home/mahdi/Desktop/pycharm-community-4.5.3/helpers/pydev/pydevd_vars.py", line 342, in evaluateExpression
    compiled = compile(expression, '<string>', 'eval')
  File "<string>", line 1
    from transformers import WEIGHTS_NAME, BertForMaskedLM
       ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mahdi/Desktop/pycharm-community-4.5.3/helpers/pydev/pydevd_comm.py", line 1071, in doIt
    result = pydevd_vars.evaluateExpression(self.thread_id, self.frame_id, self.expression, self.doExec)
  File "/home/mahdi/Desktop/pycharm-community-4.5.3/helpers/pydev/pydevd_vars.py", line 344, in evaluateExpression
    Exec(expression, updated_globals, frame.f_locals)
  File "/home/mahdi/Desktop/pycharm-community-4.5.3/helpers/pydev/pydevd_exec2.py", line 3, in Exec
    exec(exp, global_vars, local_vars)
  File "<string>", line 2, in <module>
  File "/home/mahdi/anaconda3/envs/py36/lib/python3.6/site-packages/transformers/modeling_utils.py", line 482, in from_pretrained
    if resolved_archive_file.endswith(".index"):
AttributeError: 'NoneType' object has no attribute 'endswith' 

Transformers version:2.5.1
Pytorch version: 1.3.0
**A link to original question on Stack Overflow**: 


Comments:
The `from_pretrained` method should point to a directory. Could you try to point it to a directory containing both the model weights and the config.json file?

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.